First of all, sorry if I'm just a retard here.... I'm JUST getting started coding java, and until 2 days ago I hadn't touched a line of code in over 10 years.
Anyways... I'm trying to write an app and when launched I want it to open a dialog, but without having a black activity behind it. I just want the dialog to pop up so it looks like you haven't left the home screen.
So far I THINK I'm going about this wrong to begin with... but you guys will know better than me... I'm just gonna paste the code I have and maybe you guys can help me out?
Thanks SO much in advance!
Using java Syntax Highlighting
- public class QuikNote extends Activity {
- private static final int DIALOG_CREATE = 1;
- private static final int DIALOG_EDIT = 2;
- /** Called when the activity is first created. */
- @Override
- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- //setTheme(android.R.style.Theme_Translucent_NoTitleBar);
- //getWindow().setFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND, WindowManager.LayoutParams.FLAG_BLUR_BEHIND);
- //setContentView(R.layout.main);
- showDialog(DIALOG_CREATE);
- }
- protected Dialog onCreateDialog(int id) {
- switch (id) {
- case DIALOG_CREATE:
- LayoutInflater factory = LayoutInflater.from(this);
- final View textEntryView = factory.inflate(R.layout.create_dialog, null);
- return new AlertDialog.Builder(QuikNote.this)
- .setIcon(R.drawable.create_dialog_icon)
- .setTitle(R.string.create_dialog_title)
- .setView(textEntryView)
- .setPositiveButton(R.string.create_dialog_ok, new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int whichButton) {
- finish();
- }
- })
- .setNegativeButton(R.string.create_dialog_cancel, new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int whichButton) {
- finish();
- }
- })
- .create();
- }
- return null;
- }
- }
Parsed in 0.035 seconds, using GeSHi 1.0.8.4


