Note that there are some explanatory texts on larger screens.

plurals
  1. PODialog on listview click Android 2.3
    primarykey
    data
    text
    <p>I am having a problem displaying my "Custom Bitmap Image" on my shown dialog. The image is not null. I checked through debug mode and also my listview already shows an image of it.</p> <blockquote> <p>My main question is "Am I missing a requirement or doing something wrong?". Please excuse me on this one. My first time using dialogs.</p> </blockquote> <p>I would also like to add that the dialog does shows on click.</p> <p>My generation on dialog on click</p> <pre><code>@Override protected void onListItemClick(ListView l, View v, int position, long id) { // TODO Auto-generated method stub super.onListItemClick(l, v, position, id); Dialog dialog = new Dialog(A_Test4Activity.this); dialog.setContentView(R.layout.custom_dialog); dialog.setTitle("Title"); TextView tv = (TextView)findViewById(R.id.data1); ImageView iv = (ImageView)findViewById(R.id.dialog_image); try{ Bitmap bm = bm_List.get(position); iv.setImageBitmap(bm); }catch (Exception e) { // TODO: handle exception e.printStackTrace(); } dialog.show(); } </code></pre> <p>My ArrayAdapter for listview</p> <pre><code>class IconicAdapter extends ArrayAdapter&lt;String&gt;{ IconicAdapter() { super(A_Test4Activity.this, R.layout.row, R.id.label, book_fileName_list); } public View getView(int position, View convertView, ViewGroup parent) { // String[] items = book_fileName_list.toArray(new String[book_fileName_list.size()]); View row = super.getView(position, convertView, parent); ImageView icon=(ImageView)row.findViewById(R.id.icon); TextView author = (TextView)row.findViewById(R.id.book_Author); TextView bookTitle = (TextView)row.findViewById(R.id.Book_Title); icon.setImageBitmap(bm_List.get(position)); bookTitle.setText(book_title_list.get(position)); author.setText(List_Author.get(position)); return(row); } } </code></pre> <p>My Custom Dialog.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:id="@+id/layout_root" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" &gt; &lt;ImageView android:id="@+id/dialog_image" android:layout_width="300px" android:layout_height="300px" android:src="@drawable/temp_book" /&gt; &lt;ScrollView android:id="@+id/scroller" android:layout_width="fill_parent" android:layout_height="wrap_content" &gt; &lt;LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content"&gt; &lt;TextView android:id="@+id/data1" android:layout_width="fill_parent" android:layout_height="wrap_content" android:textColor="#FFF" android:textSize="10sp" android:text="Data1" /&gt; &lt;/LinearLayout&gt; &lt;/ScrollView&gt; &lt;Button android:id = "@+id/confirm" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="CONFIRM"/&gt; &lt;Button android:id = "@+id/close" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="CLOSE"/&gt; &lt;/LinearLayout&gt; </code></pre> <p>Forgot to put my logcat error</p> <pre><code>02-23 16:00:02.862: W/TextLayoutCache(2286): computeValuesWithHarfbuzz -- need to force to single run 02-23 16:00:04.495: W/System.err(2286): java.lang.NullPointerException 02-23 16:00:04.495: W/System.err(2286): at test.list.A_Test4Activity.onListItemClick(A_Test4Activity.java:328) 02-23 16:00:04.495: W/System.err(2286): at android.app.ListActivity$2.onItemClick(ListActivity.java:319) 02-23 16:00:04.495: W/System.err(2286): at android.widget.AdapterView.performItemClick(AdapterView.java:292) 02-23 16:00:04.495: W/System.err(2286): at android.widget.AbsListView.performItemClick(AbsListView.java:1058) 02-23 16:00:04.495: W/System.err(2286): at android.widget.AbsListView$PerformClick.run(AbsListView.java:2514) 02-23 16:00:04.495: W/System.err(2286): at android.widget.AbsListView$1.run(AbsListView.java:3168) 02-23 16:00:04.495: W/System.err(2286): at android.os.Handler.handleCallback(Handler.java:605) 02-23 16:00:04.495: W/System.err(2286): at android.os.Handler.dispatchMessage(Handler.java:92) 02-23 16:00:04.495: W/System.err(2286): at android.os.Looper.loop(Looper.java:137) 02-23 16:00:04.495: W/System.err(2286): at android.app.ActivityThread.main(ActivityThread.java:4340) 02-23 16:00:04.495: W/System.err(2286): at java.lang.reflect.Method.invokeNative(Native Method) 02-23 16:00:04.495: W/System.err(2286): at java.lang.reflect.Method.invoke(Method.java:511) 02-23 16:00:04.495: W/System.err(2286): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784) 02-23 16:00:04.503: W/System.err(2286): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551) 02-23 16:00:04.503: W/System.err(2286): at dalvik.system.NativeStart.main(Native Method) </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.
    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