Ich möchte die Textview klicken, um esProceeding auf eine andere Tätigkeit von Textview klicken
in die zweite Klasse Aktivität zu gehenpublic void click(View v){
Intent intent;
switch(v.getId()){
case R.id.titleExpense:
intent = new Intent(this,userExpense.class);
break;
case R.id.titleIncome:
intent = new Intent(this,userIncome.class);
break;
}
startActivity(intent);
}
Der Fehler, den ich habe, ist die Absicht startActivity (Absicht), ich bin nicht ganz sicher, wo ich es erklären soll.
Layout: (Das Gleiche gilt für die Erträge ein)
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/titleExpense"
android:id="@+id/titleExpense"
android:textSize="20sp"
android:clickable="true"
android:onClick="onClick"
android:layout_below="@+id/txtGroup"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />
Von der Manifest-Datei:
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".userExpense" />
<activity android:name=".userIncome"></activity>
</application>
können Sie den vollständigen Code posten! – dauruy
please stacktrace – Basi
Bitte überprüfen Sie meine Antwort @Ralph – SaravInfern