----------------------------------------- MainActivity. java
Package com. example. pup;
Import android. app. Activity;
Import android. content. Intent;
Import android. OS. Bundle;
Import android. view. KeyEvent;
Public class MainActivity extends Activity {
@ Override
Public void onCreate (Bundle savedInstanceState ){
Super. onCreate (savedInstanceState );
SetContentView (R. layout. activity_main );
}
@ Override
Public boolean onKeyDown (
Int keyCode, KeyEvent event ){
// The method stub automatically generated by TODO
If (keyCode = KeyEvent. KEYCODE_MENU ){
Intent intent = new Intent (MainActivity. this, Pop. class );
StartActivity (intent );
}
Return super. onKeyDown (keyCode, event );
}
}
------------------------------- Pop. java
Package com. example. pup;
Import android. app. Activity;
Import android. OS. Bundle;
Public class Pop extends Activity {
@ Override
Protected void onCreate (
Bundle savedInstanceState ){
// The method stub automatically generated by TODO
Super. onCreate (savedInstanceState );
SetContentView (R. layout. alert_dialog );
}
}
---------------------------------- MANIFEST. XML
<Manifest xmlns: android = "http://schemas.android.com/apk/res/android"
Package = "com. example. pup"
Android: versionCode = "1"
Android: versionName = "1.0" type = "codeph" text = "/codeph">
<Uses-sdk
Android: minSdkVersion = "8"
Android: targetSdkVersion = "15"/>
<Application
Android: icon = "@ drawable/ic_launcher"
Android: label = "@ string/app_name"
Android: theme = "@ style/AppTheme">
<Activity
Android: name = ". MainActivity"
Android: label = "@ string/title_activity_main">
<Intent-filter>
<Action android: name = "android. intent. action. MAIN"/>
<Category android: name = "android. intent. category. LAUNCHER"/>
</Intent-filter>
</Activity>
<Activity
Android: name = ". Pop"
Android: theme = "@ style/MyDialogStyleBottom"/>
</Application>
</Manifest>
---------- STYLES
<Resources>
<Style name = "AppTheme" parent = "android: Theme. Light"/>
<Style name = "AnimBottom" parent = "@ android: style/Animation">
<Item name = "android: windowEnterAnimation"> @ anim/push_bottom_in2 </item>
<Item name = "android: javaswexitanimation"> @ anim/push_bottom_out </item>
</Style>
<Style name = "MyDialogStyleBottom" parent = "android: Theme. Dialog">
<Item name = "android: windowAnimationStyle"> @ style/AnimBottom </item>
<Item name = "android: windowFrame"> @ null </item>
<! -- Border -->
<Item name = "android: incluwisfloating"> true </item>
<! -- Whether to float above the activity -->
<Item name = "android: javaswistranslucent"> true </item>
<! -- Translucent -->
<Item name = "android: windowNoTitle"> true </item>
<! -- No title -->
<Item name = "android: windowBackground"> @ android: color/transparent </item>
<! -- Transparent background -->
<Item name = "android: backgroundDimEnabled"> true </item>
<! -- Fuzzy -->
</Style>
</Resources>