rawable/icon" android:label="@string/app_name"> <activity android:name=".Activity1" android:taskAffinity="com.winuxxan.task" android:label="@string/app_name"> </activity> <activity android:name=".Activity2"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> </application> Activity2的代码如下:
[java] view plaincopyprint? 01.public class Activity2 extends Activity { 02. private static final String TAG = "Activity2"; 03. @Override 04. protected void onCreate(Bundle savedInstanceState) { 05. super.onCreate(savedInstanceState); 06. setContentView(R.layout.main2); 毕业论文 07. } 08. 09. @Override 10. public boolean onTouchEvent(MotionEvent event) { 11. Intent intent = new Intent(this, Activity1.class); 12. intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); 13. startActivity(intent); 14. return super.onTouchEvent(event); 15. } 16. } public class Activity2 extends Activity { private static final String TAG = "Activity2";
上一页 [1] [2] [3] [4] 下一页
|