Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)

Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4362: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4364: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4365: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4366: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
anddev.org • View topic - AlertDialog in onCreate - please help

AlertDialog in onCreate - please help

Put problem concerning Views, Layouts and other XML-Resources (like AndroidManifest) here.

AlertDialog in onCreate - please help

Postby radhoo » Fri Sep 04, 2009 10:43 pm

Hi every1.

I use AlertDialog to display short messages like:

new AlertDialog.Builder(v.getContext())
.setTitle("KBDrv")
.setMessage("About")
//.setPositiveButton(android.R.string.ok, null)
.show();
for eg. in a button onClick callback (View v).

Now the problem is I don't know how to replace the v.getContext() for displaying the message box in onCreate.

"09-05 00:33:08.455: WARN/WindowManager(59): Attempted to add window with non-application token WindowToken{430b0b78 token=null}. Aborting."

putting this or this.getApplicationContext() results in application crash an no dialog is displayed.


Please advise. This is urgent.
radhoo
Freshman
Freshman
 
Posts: 3
Joined: Wed May 13, 2009 11:08 am

Top

Re: AlertDialog in onCreate - please help

Postby radhoo » Sat Sep 05, 2009 9:28 am

radhoo wrote:I use AlertDialog to display short messages like:


Found the issue. in OnCreate the application window is not yet created, so a view is not available.

Putting the messagebox code in onStart works.

public void onStart()
{
super.onStart();
Log.d("ONStart", "onstart");
new AlertDialog.Builder(this)
.setTitle("Bluetooth UI")
.setMessage("To use this software, ...")
.show();

Hope this helps others.
radhoo
Freshman
Freshman
 
Posts: 3
Joined: Wed May 13, 2009 11:08 am

Top

Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: No registered users and 1 guest