Dialo

by Fluckysan » Tue, 09 Jun 2009 01:19:04 GMT


Sponsored Links
 Hello everybody,
i just begin with the SDK so I play around but I'm stuck with a really
simple Dialog.show() ...
It maybe is because it'es really late or something but here my code :

public class entry extends Activity {
        static final int CREATE_DIALOG = 0;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        setContentView(R.layout.entry);
    }

    public boolean onCreateOptionsMenu(Menu menu) {
        MenuInflater inflater = getMenuInflater();

        inflater.inflate(R.menu.menu_bottom, menu);
        return true;
    }

    public boolean onOptionsItemSelected(MenuItem item) {
        switch (item.getItemId()) {
                case R.id.create:
                    this.showDialog(CREATE_DIALOG);

                return true;
            }

            return false;
    }

        protected Dialog onCreateDialog(int id) {
                Dialog dialog;

                switch(id) {
                    case CREATE_DIALOG:
                        dialog = new Dialog(this.getApplicationContext());

                        dialog.setContentView(R.layout.create_dialog);
                        dialog.setTitle("Pwals");
                    break;

                    default:
                        dialog = null;
                    break;
            }

            return dialog;
        }
}

The XMLs are just as simple as this code and they are running good
It crash when I it the menu button "create"
What I haven't understand :s ?

Thx for your answer

--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. i am Mca fresher ,i want job on android.

Tell me where are opening for android developer at Pune .
and Bangalore.
send me ebook also thanks.
 plzzzzzzzz help me

-- 

2. [WTA] Tutorial dan tools untuk Inject Droid 2

Selamat Malam semuanya,
Ada yang bisa bantu tutorial dan tools untuk inject Droid 2 ; atau ada
yang punya linknya
Sebelumnya tq dulu

-- 
===============
"

3. OOT: Paging Yopie

4. Server errors

5. Best Design for Android App

6. Window already focused:ignoring focus gain android

7. (WTB) otterbox desire and hh android