Note that there are some explanatory texts on larger screens.

plurals
  1. POListView onItemClick: NullPointerException retrieving views
    primarykey
    data
    text
    <p>I cant click on list view to pass new activity. please advice me how to solve this problem.</p> <p>here my code</p> <pre><code>// set UI setContentView(R.layout.show_permission); //get list from background show = getListView(); //object for permission list permission_list = new ArrayList&lt;HashMap&lt;String,String&gt;&gt;(); // get uid from main activity Intent i = getIntent(); uid = i.getStringExtra(TAG_UID); // get data from background thread new GetPermission().execute(); show.setOnItemClickListener(new OnItemClickListener() { @Override public void onItemClick(AdapterView&lt;?&gt; parent, View view, int position, long id) { // TODO Auto-generated method stub //getting item from list Item String project_id = ((TextView) view.findViewById(R.id.report_id)).getText().toString(); &lt;---error here String project_name = ((TextView) view.findViewById(R.id.pro_name)).getText().toString(); Intent in = getIntent(); //send report_id to next activity in.putExtra(TAG_PROJECT_ID, project_id); in.putExtra(TAG_PROJECT_NAME, project_name); in.putExtra(TAG_UID, uid); setResult(100, in); finish(); } }); </code></pre> <p>and here log cat display</p> <pre><code> 09-25 15:41:27.510: E/AndroidRuntime(1457): FATAL EXCEPTION: main 09-25 15:41:27.510: E/AndroidRuntime(1457): java.lang.NullPointerException 09-25 15:41:27.510: E/AndroidRuntime(1457): at com.example.androidhive.ProjectPermission$1.onItemClick(ProjectPermission.java:82) 09-25 15:41:27.510: E/AndroidRuntime(1457): at android.widget.AdapterView.performItemClick(AdapterView.java:298) 09-25 15:41:27.510: E/AndroidRuntime(1457): at android.widget.AbsListView.performItemClick(AbsListView.java:1086) 09-25 15:41:27.510: E/AndroidRuntime(1457): at android.widget.AbsListView$PerformClick.run(AbsListView.java:2855) 09-25 15:41:27.510: E/AndroidRuntime(1457): at android.widget.AbsListView$1.run(AbsListView.java:3529) 09-25 15:41:27.510: E/AndroidRuntime(1457): at android.os.Handler.handleCallback(Handler.java:615) 09-25 15:41:27.510: E/AndroidRuntime(1457): at android.os.Handler.dispatchMessage(Handler.java:92) 09-25 15:41:27.510: E/AndroidRuntime(1457): at android.os.Looper.loop(Looper.java:137) 09-25 15:41:27.510: E/AndroidRuntime(1457): at android.app.ActivityThread.main(ActivityThread.java:4745) 09-25 15:41:27.510: E/AndroidRuntime(1457): at java.lang.reflect.Method.invokeNative(Native Method) 09-25 15:41:27.510: E/AndroidRuntime(1457): at java.lang.reflect.Method.invoke(Method.java:511) 09-25 15:41:27.510: E/AndroidRuntime(1457): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786) 09-25 15:41:27.510: E/AndroidRuntime(1457): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553) 09-25 15:41:27.510: E/AndroidRuntime(1457): at dalvik.system.NativeStart.main(Native Method) </code></pre> <p>thanks for help!</p>
    singulars
    1. This table or related slice is empty.
    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.
 

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