Note that there are some explanatory texts on larger screens.

plurals
  1. POClicking items in ListAdapter doesn't do anything
    primarykey
    data
    text
    <p>I'm trying to make my first list adapter with android, and it comes up with the list, but when I click the items, nothing happens. My only guess is the comment I have after the line that defines Class cvar.</p> <pre><code>package scouting.form; import android.app.ListActivity; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.widget.ArrayAdapter; import android.widget.ListView; public class Menu extends ListActivity{ String classes[] = {"SCOUTING","LOGIN","MAIN"}; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setListAdapter(new ArrayAdapter&lt;String&gt;(Menu.this,android.R.layout.simple_list_item_1,classes)); } @Override protected void onListItemClick(ListView l, View v, int position,long id) { super.onListItemClick(l, v, position, id); String cheese= "com.cody.graham."+classes[position]; try{ Class cvar=Class.forName(cheese); //Eclipse has a warning on this line "Class is a raw type. References to generic type Class&lt;T&gt; should be parameterized". I don't really know what that means. Intent intention=new Intent(Menu.this,cvar); startActivity(intention); }catch(ClassNotFoundException e){ e.printStackTrace(); } } } </code></pre> <p>Edit:</p> <p>Part of the AndroidManifest:</p> <pre><code>&lt;activity android:name=".splash_screen" android:label="@string/title_activity_splash" &gt; &lt;intent-filter&gt; &lt;action android:name="android.intent.action.MAIN" /&gt; &lt;category android:name="android.intent.category.LAUNCHER" /&gt; &lt;/intent-filter&gt; &lt;/activity&gt; &lt;activity android:name=".Login" android:label="@string/title_activity_login" android:exported="false"&gt; &lt;intent-filter&gt; &lt;action android:name="com.cody.graham.LOGIN" /&gt; &lt;category android:name="android.intent.category.DEFAULT" /&gt; &lt;/intent-filter&gt; &lt;/activity&gt; &lt;activity android:name=".Scouting" android:label="@string/title_activity_scouting" android:exported="false"&gt; &lt;intent-filter&gt; &lt;action android:name="com.cody.graham.SCOUTING" /&gt; &lt;category android:name="android.intent.category.DEFAULT" /&gt; &lt;/intent-filter&gt; &lt;/activity&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.
 

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