Note that there are some explanatory texts on larger screens.

plurals
  1. POCustom ListView in a dialog
    primarykey
    data
    text
    <p>i have a list view , inside this list when click on an item of it ,it will show a custom list inside a dialog box </p> <p>the dialog shows up but its only shows the title of the dialog </p> <p>here is my code </p> <pre><code> case R.id.CommentNumOfLike: dbobj = new DataBaseHandler(getContext()); Items1 = dbobj.select_HowComment(); dbobj.CloseDataBase(); Collections.reverse(Items1); x = (Integer) view.getTag(); Log.v("value", x + ""); target = Items1.get(x).getCommentId().toString(); CommentEvents r = new CommentEvents(); r.execute(user_id, secret_id, table, target); final Dialog dialog = new Dialog(getContext()); dialog.setContentView(R.layout.likers_list); dialog.setTitle("List of likers"); dialog.setCanceledOnTouchOutside(true); dbobj = new DataBaseHandler(getContext()); likeItems=dbobj.select_HowlikeComment(); dbobj.CloseDataBase(); ListView list = (ListView) dialog.findViewById(R.id.ListLikersList); LikersCustomeAdapter adapter= new LikersCustomeAdapter(getContext(), R.layout.likerscustomelist, likeItems); list.setAdapter(adapter); dialog.show(); break; </code></pre> <p>this is my adapter </p> <pre><code> public class LikersCustomeAdapter extends ArrayAdapter&lt;LikersComment&gt;{ Context context; List&lt;LikersComment&gt; items; Bitmap bitmap; String imageUser = ""; String filePath_Image = "/Pictures/jehad/joj/"; public LikersCustomeAdapter(Context context, int textViewResourceId, List&lt;LikersComment&gt; objects) { super(context, textViewResourceId, objects); // TODO Auto-generated constructor stub this.context=context; } public View getView(final int position, View convertView, ViewGroup parent) { Log.d("View likers List", "View&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;"); likerscommentholder h = null; View v = convertView; Log.v("items getName", items.get(position).getName()); LayoutInflater vi = (LayoutInflater) context .getSystemService(Activity.LAYOUT_INFLATER_SERVICE); if (v == null) { v = vi.inflate(R.layout.likerscustomelist,null); h = new likerscommentholder(); h.likersimg=(ImageView)v.findViewById(R.id.likersImg); h.likersname=(TextView)v.findViewById(R.id.likersName); v.setTag(h); } else { h = (likerscommentholder) v.getTag(); } imageUser = items.get(position).getId() + items.get(position).getRand(); boolean flag_ImagePath = Methods.checkIfImage_DirExists(filePath_Image + imageUser); if (flag_ImagePath == true) { Log.v("flag_ImagePath", String.valueOf(flag_ImagePath)); bitmap = Methods.displayBitmapImage(imageUser); h.likersimg.setImageBitmap(bitmap); } h.likersname.setText(items.get(position).getName()); return v; } } class likerscommentholder { ImageView likersimg; TextView likersname; } </code></pre> <p>this is the list view </p> <p>likers_list.xml</p> <pre><code> &lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" &gt; &lt;ListView android:id="@+id/ListLikersList" android:layout_width="match_parent" android:layout_height="wrap_content" &gt; &lt;/ListView&gt; </code></pre> <p></p> <p>this is the custom layout </p> <p>likerscustomelist.xml</p> <pre><code> &lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" &gt; &lt;RelativeLayout android:layout_width="match_parent" android:layout_height="match_parent" &gt; &lt;ImageView android:id="@+id/likersImg" android:layout_width="65dp" android:layout_height="65dp" android:layout_alignParentLeft="true" android:layout_alignParentTop="true" android:src="@drawable/ic_launcher" /&gt; &lt;TextView android:id="@+id/likersName" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentTop="true" android:layout_marginLeft="16dp" android:layout_marginTop="19dp" android:layout_toRightOf="@+id/likersImg" android:text="Medium Text" android:textAppearance="?android:attr/textAppearanceMedium" /&gt; &lt;/RelativeLayout&gt; &lt;/LinearLayout&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload