的Manifest.xml
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
>
<activity
android:name="com.teamandy.MainActivity"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
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:theme="@*android:style/Theme.Black.NoTitleBar" android:name="com.teamandy.Choosetype" android:screenOrientation="portrait" />
<activity android:theme="@*android:style/Theme.Black.NoTitleBar" android:name="com.teamandy.frames1" android:screenOrientation="portrait" />
</application>
主要活动:
this.startb=(Button)findViewById(R.id.btn_start);
this.startb.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent strtint=new Intent(MainActivity.this, Choosetype.class);
//strtint.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK);
strtint.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
strtint.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
strtint.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(strtint);
finish();
}
});
Choosetype活动:
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
this.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.choosefrm);
}
public void f1(View v ){
Choosetype.number=1;
this.mcontexts=this;
startActivity();
}
public void f2(View v){
Choosetype.number=2;
this.mcontexts=this;
startActivity();
.........................unti f20 etc. used