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

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

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

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 - [TinyTut] - Displaying a Messagebox

[TinyTut] - Displaying a Messagebox

Basic Tutorials concerning: GUI, Views, Activites, XML, Layouts, Intents, ...

Can't get this to work

Postby cre » Mon Nov 03, 2008 3:21 am

Nothing appears on the screen.
Can you give me a complete example. Eclipse gave me an error for not including the void which you did not have in your example
Here's my code...
thks,
cre
___________________

package com.adndroid.something;

import android.app.Activity;
import android.os.Bundle;

public class some extends Activity {
/** Called when the activity is first created. */
void showAlert(CharSequence title, CharSequence message, CharSequence buttonText, boolean cancelable){};
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);

initControls();

}



private void initControls()

{

showAlert("A funny title", "MessageBoxes rule extremely!", "Hit Me!",false);

}

}
cre
Freshman
Freshman
 
Posts: 5
Joined: Mon Nov 03, 2008 3:04 am

Top

Re: [TinyTut] - Displaying a Messagebox

Postby manish » Fri Jun 12, 2009 10:35 am

plusminus wrote:
[TinyTut] - Displaying a Messagebox


Hi,

I am getting an error that showAlert function is not presnent in android.

What you learn: You will learn how easy it is, to display a MessageBox (showAlert(...)).

Difficulty: 0 of 5 :roll:

What it will look like:
Image


Description
This has been a very common question, as in "normal" Java a MessageBox was displayed with code like:
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. JOptionPane.showMessageDialog(...);
Parsed in 0.012 seconds, using GeSHi 1.0.8.4

in Android you can do almost the same with the following code:
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. showAlert("A funny title", "MessageBoxes rule extremely!", "Hit Me!", false);
  2. // Where the definition of the function is (simplest of 4 different):
  3. showAlert(CharSequence title, CharSequence message, CharSequence buttonText, boolean cancelable)
Parsed in 0.010 seconds, using GeSHi 1.0.8.4


Regards,
plusminus
manish
Junior Developer
Junior Developer
 
Posts: 21
Joined: Thu Feb 05, 2009 1:06 pm

Top
Previous

Return to Novice Tutorials

Who is online

Users browsing this forum: Yahoo [Bot] and 3 guests