The pop-up window at the bottom of Android overwrites the MENU

Source: Internet
Author: User

 


----------------------------------------- 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>

 

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.