Created
April 18, 2012 14:34
-
-
Save basharam/2413989 to your computer and use it in GitHub Desktop.
How to show Activity as Dilaog without buttons in Android
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ActivityasDlg extends Activity { | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activtyasdlg); | |
} | |
@Override | |
protected void onDestroy() { | |
finish(); | |
super.onDestroy(); | |
} | |
@Override | |
protected void onPause() { | |
Log.d(getClass().getName(),"pause" ); | |
finish(); | |
super.onPause(); | |
} | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// in layout folder | |
<?xml version="1.0" encoding="utf-8"?> | |
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
android:layout_width="fill_parent" | |
android:layout_height="wrap_content" | |
android:background="@android:drawable/dialog_frame" | |
android:layout_gravity="center|center_vertical|fill_horizontal" | |
android:orientation="vertical" > | |
<TextView | |
android:id="@+id/textView1" | |
android:layout_width="fill_parent" | |
android:layout_height="wrap_content" | |
android:text="QApp Upload Info" | |
android:gravity="center_horizontal" | |
android:padding="4dip" | |
android:textAppearance="?android:attr/textAppearanceLarge" /> | |
<View | |
android:layout_width="fill_parent" | |
android:layout_height="1dip" | |
android:background="#fff" | |
/> | |
<TextView | |
android:padding="35dip" | |
android:id="@+id/textView2" | |
android:layout_width="fill_parent" | |
android:layout_height="wrap_content" | |
android:layout_weight="1" | |
android:gravity="center_horizontal" | |
android:textAppearance="?android:attr/textAppearanceMedium" /> | |
</LinearLayout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// add activty to manifest files | |
<activity android:name="com.ActivityasDlg" android:noHistory="true" android:screenOrientation="portrait" android:excludeFromRecents="true"></activity> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment