What did i wrong ?
Я думаю, что я ошибаюсь в действии намерения и от startActivity. Что я должен сделать правильно?Android простая кнопка
Основная деятельность:
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Button buttonPainting = (Button)findViewById(R.id.buttonPainting);
buttonPainting.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
startActivity(new Intent("com.example.menupainting.paintingbutton")); here i put paintingbutton.java ?
}
});
Основная деятельность XML:
<Button
android:id="@+id/buttonPainting"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignRight ="@+id/textView1"
android:layout_below="@+id/textView1"
android:layout_marginTop="24dp"
android:text="Paint" />
AndroidManifest.xml:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.menupainting"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="18" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="com.example.menupainting.MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.example.menupainting.paintingbutton"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.PAINTINGBUTTON" /> Here on intent action what should i put
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
</application>
</manifest>
ли у Вас какие-либо ошибки LogCat ? –