CustomDialogActivity.java
Using java Syntax Highlighting
- package com.example.android.apis.app;
- // Need the following import to get access to the app resources, since this
- // class is in a sub-package.
- import com.example.android.apis.R;
- import android.app.Activity;
- import android.os.Bundle;
- public class CustomDialogActivity extends Activity {
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- // Be sure to call the super class.
- super.onCreate(savedInstanceState);
- // See assets/res/any/layout/dialog_activity.xml for this
- // view layout definition, which is being set here as
- // the content of our screen.
- setContentView(R.layout.custom_dialog_activity);
- }
- }
Parsed in 0.031 seconds, using GeSHi 1.0.8.4
res/layout/custom_dialog_activity.xml
Using xml Syntax Highlighting
- <?xml version="1.0" encoding="utf-8"?>
- <TextView xmlns:android="http://schemas.android.com/apk/res/android"
- android:id="@+id/text"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- android:gravity="center_vertical|center_horizontal"
- android:text="Default text. You can print there your custom text, or add more components to layout "/>
Parsed in 0.001 seconds, using GeSHi 1.0.8.4
res/value/styles.xml
Using xml Syntax Highlighting
- <?xml version="1.0" encoding="utf-8"?>
- <resources>
- <!-- Base application theme is the default theme. -->
- <style name="Theme" parent="android:Theme">
- </style>
- <!-- A theme for a custom dialog appearance. Here we use an ugly
- custom frame. -->
- <style name="Theme.CustomDialog" parent="android:style/Theme.Dialog">
- <item name="android:windowBackground">@drawable/filled_box</item>
- </style>
- </resources>
Parsed in 0.002 seconds, using GeSHi 1.0.8.4
res/drawable/filled_box.xml
Using xml Syntax Highlighting
- <?xml version="1.0" encoding="utf-8"?>
- <shape xmlns:android="http://schemas.android.com/apk/res/android">
- <solid android:color="#f0600000"/>
- <stroke android:width="3dp" color="#ffff8080"/>
- <corners android:radius="3dp" />
- <padding android:left="10dp" android:top="10dp"
- android:right="10dp" android:bottom="10dp" />
- </shape>
Parsed in 0.002 seconds, using GeSHi 1.0.8.4
AndroidManifest.xml
Using xml Syntax Highlighting
- <activity android:name=".app.CustomDialogActivity"
- android:label="@string/activity_custom_dialog"
- android:theme="@style/Theme.CustomDialog">
- <intent-filter>
- <action android:name="android.intent.action.MAIN" />
- <category android:name="android.intent.category.SAMPLE_CODE" />
- </intent-filter>
- </activity>
Parsed in 0.001 seconds, using GeSHi 1.0.8.4
P.S. I'm sorry for my style, but it's my first tutorial. I will modify it latter.
I mised one string @string/activity_custom_dialog, you can enter there you title, or add string to the values.
I find tutorial where use this customdialog here
P.P.S. May by I'm not lucky but this code from my tutorial doesn't work in my emulator
I have black background.

