@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main2); } @Override public boolean onTouchEvent(MotionEvent event) { Intent intent = new Intent(this, Activity1.class); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); startActivity(intent); return super.onTouchEvent(event); } } 然后,我们再写一个应用MyActivity,它包含一个Activity(MyActivity),AndroidManifest.xml如下:
[html] view plaincopyprint? 01.<application android:icon="@drawable/icon" android:label="@string/app_name"> 02. <activity android:name=".MyActivity" 03. android:taskAffinity="com.winuxxan.task" 04. android:label="@string/app_name"> 05. <intent-filter> 06. <action android:name="android.intent.action.MAIN"/> 07. <category android:name="android.intent.category.LAUNCHER"/> 08. </intent-filter> 09. </activity> <application android:icon="@drawable/icon" android:label="@string/app_name"> <activity android:name=".MyActivity" android:taskAffinity="com.winuxxan.task" android:label="@string/app_name"> <intent-filter> <action android:name="android.intent.action.MAIN"/>毕业论文 上一页 [1] [2] [3] [4] 下一页
|