im trying to create custom dialog, but im getting an error when calling show() function. I am not sure if i missed some step in creating the dialog. here's the code:
public class TrackerSettingsActivity extends Activity {
Context context;
PhoneStateBroadcastReciever prefs;
Handler handler;
SharedPreferences m_sharedPrefs;
Editor editor;
EditText timerDelay;
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.tracker_settings);
timerDelay = (EditText) findViewById(R.id.editText_Set_Timer);
m_sharedPrefs = getSharedPreferences("MyPrefs", 0);
editor = m_sharedPrefs.edit();
Button button = (Button) findViewById(R.id.button_Confirm);
button.setOnClickListener(new OnClickListener() {
#Override
public void onClick(View v) {
customDialog().show();
}
}
private Dialog customDialog() {
final Dialog dialog = new Dialog(getBaseContext());
dialog.setContentView(R.layout.login_dialog);
dialog.setTitle("Title...");
// set the custom dialog components - text, image and button
TextView text = (TextView) dialog.findViewById(R.id.text);
text.setText("Android custom dialog example!");
ImageView image = (ImageView) dialog.findViewById(R.id.image);
image.setImageResource(R.drawable.ic_launcher);
Button dialogButton = (Button) dialog.findViewById(R.id.dialogButtonOK);
// if button is clicked, close the custom dialog
dialogButton.setOnClickListener(new OnClickListener() {
#Override
public void onClick(View v) {
dialog.dismiss();
}
});
return dialog;
}
}
login_dialog.xml:
<ImageView
android:id="#+id/image"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="5dp"
android:src="#drawable/ic_launcher" />
<TextView
android:id="#+id/text"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/image"
android:text="sss"
android:textColor="#FFF" />
<Button
android:id="#+id/dialogButtonOK"
android:layout_width="100px"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/text"
android:text=" Ok " />
tracker_settings.xml:
<TextView
android:id="#+id/textView_Set_Timer"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginTop="68dp"
android:text="#string/tv_settimer"
android:textColor="#ffffff" />
<EditText
android:id="#+id/editText_Set_Timer"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignRight="#+id/textView_Set_Timer"
android:layout_below="#+id/textView_Set_Timer"
android:ems="10"
android:inputType="number"
android:textColorHint="#ffffff" />
<Button
android:id="#+id/button_Confirm"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/editText_Set_Timer"
android:onClick="click"
android:text="#string/bn_confirm" />
I dont know why show() wont work...
If someone have some other suggestion im am willing to listen...
Thanks in advance!
Use this: use activity reference when you have to create a Dialog.
Actvity activity = this;
private Dialog customDialog() {
final Dialog dialog = new Dialog(activity); // or new Dialog(YourActivity.this);
dialog.setContentView(R.layout.login_dialog);
....
}
Your custom dialog can't be added due to it not having a parent view. As #jzafrilla has stated, add an activity reference to your constructor, so that android knows what to attach it to.
... = new Dialog(Main.this); // or something similar
If you do this, then you should be able to see your dialog on top of the parent view
Related
I am trying to implement a share action that on user's choice, he gets a popup dialog with specific share actions (over specific distinct apps - desired screen:desired layout).
I would like to have 6 ImageButtons.
Till now, I could get the popup window (but the onclick listenes - were like dead) or (on the other hand) the app would crash.
My Layout for the popup is:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#color/colorAccent">
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:srcCompat="#drawable/viber"
android:id="#+id/viber_share_button"
android:layout_below="#+id/twitter_share_button"
android:background="#color/colorAccent"
android:layout_alignEnd="#+id/twitter_share_button"
android:layout_marginBottom="10dp"
android:layout_marginLeft="10dp"
android:layout_toEndOf="#+id/facebook_share_button" />
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:srcCompat="#drawable/twitter"
android:id="#+id/twitter_share_button"
android:background="#color/colorAccent"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="10dp"
android:layout_marginLeft="10dp"
android:layout_marginTop="10dp"/>
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:srcCompat="#drawable/facebook_messenger"
android:id="#+id/messanger_share_button"
android:background="#color/colorAccent"
android:layout_marginLeft="10dp"
android:layout_alignTop="#+id/viber_share_button"
android:layout_alignEnd="#+id/facebook_share_button" />
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:srcCompat="#drawable/instagram"
android:id="#+id/instagram_share_button"
android:background="#color/colorAccent"
android:layout_marginLeft="10dp"
android:layout_alignParentTop="true"
android:layout_toEndOf="#+id/twitter_share_button"
android:layout_marginStart="31dp"
android:layout_marginTop="10dp"/>
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:srcCompat="#drawable/whatsapp"
android:id="#+id/whatsapp_share_button"
android:background="#color/colorAccent"
android:layout_alignTop="#+id/viber_share_button"
android:layout_alignEnd="#+id/instagram_share_button"
android:layout_toEndOf="#+id/viber_share_button"
android:layout_alignStart="#+id/instagram_share_button" />
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:srcCompat="#drawable/facebook"
android:id="#+id/facebook_share_button"
android:background="#color/colorAccent"
android:layout_marginLeft="10dp"
android:layout_alignParentTop="true"
android:layout_toStartOf="#+id/twitter_share_button"
android:layout_marginEnd="39dp"
android:layout_marginTop="10dp"/>
</RelativeLayout>
the code that I use is:
private void displayIntentOptions(final Bitmap bitmap){
LayoutInflater layoutInflater = LayoutInflater.from(this);
View promptView = layoutInflater.inflate(R.layout.share_buttons, null);
final AlertDialog alertD = new AlertDialog.Builder(this).create();
alertD.setView(promptView);
alertD.show();
ImageButton facebook_button = (ImageButton)findViewById(R.id.facebook_share_button);
ImageButton twitter_button = (ImageButton)findViewById(R.id.twitter_share_button);
ImageButton intagram_button = (ImageButton)findViewById(R.id.instagram_share_button);
ImageButton messanger_button = (ImageButton)findViewById(R.id.messanger_share_button);
ImageButton viber_button = (ImageButton)findViewById(R.id.viber_share_button);
ImageButton whatsapp_button = (ImageButton)findViewById(R.id.whatsapp_share_button);
facebook_button.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View v) {
}
});
twitter_button.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View v) {
shareTwitter(v, bitmap);//just a sample of what I want to do
}
});
intagram_button.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View v) {
}
});
messanger_button.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View v) {
}
});
viber_button.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View v) {
}
});
whatsapp_button.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View v) {
}
});
}
This code doesn't work at all. I would be thankful, If someone could help me with this. Since on a regular dialog I cannot have all those ImageButtons, I tried to make a custom one.
Furthermore, I would like to know if this is a good practice, or I should implement a new Intent for this.
Thanks in Advance.
You need to change one little thing
Was
final AlertDialog alertD = new AlertDialog.Builder(this).create();
alertD.setView(promptView);
alertD.show();
Now
final AlertDialog.Builder alertD = new AlertDialog.Builder(this);
alertD.setView(promptView);
alertD.show();
Update
Also there is a problem in this
ImageButton facebook_button = (ImageButton)findViewById(R.id.facebook_share_button);
It will be null, because you'r looking at Activity(or fragments) views, but not in AlertDialog ones. You need to set it like this
ImageButton facebook_button = (ImageButton)promptView.findViewById(R.id.facebook_share_button);
How to get onclick of a view in custom dialog in an activity in android?
My XML is:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#color/default_green"
android:orientation="vertical" >
<TextView
android:id="#+id/tvSetNotificationsHeading"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_margin="5dp"
android:text="Set Notifications On"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="#color/white" />
<RadioButton
android:id="#+id/rbFriendRequest"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginTop="5dp"
android:text="Friend Request"
android:textColor="#android:color/white" />
<RadioButton
android:id="#+id/rbMessages"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginTop="5dp"
android:text="Messages"
android:textColor="#android:color/white" />
<Button
android:id="#+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_margin="5dp"
android:onClick="saveSetNotificationsDialog"
android:text="Save" />
</LinearLayout>
My code is:
public void showSetNotificationsDialog(View v) {
dialog = new Dialog(Activity_Settings.this);
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
dialog.setContentView(R.layout.dialog_setnotificationsdialog);
rbFriendRequest = (RadioButton) findViewById(R.id.rbFriendRequest);
rbMessages = (RadioButton) findViewById(R.id.rbMessages);
dialog.show();
}
I am able to show dialog view but no able to get on click of dialog save button in activity class. Error was no method found exception.
use instance of dialog for findViewById()
Button declineButton = (Button) dialog.findViewById(R.id.declineButton);
declineButton.setOnClickListener(new OnClickListener() {
#Override
public void onClick(View v) {
// Close dialog
dialog.dismiss();
}
});
use as following code
dialog = new Dialog(Activity_Settings.this);
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
View view = View.inflate(getActivity(), R.layout.dialog_setnotificationsdialog, null);
dialog.setContentView(view);
//always find your view view.findViewbyid
yourView= (RadioButton) view.findViewById(R.id.rbFriendRequest);
//then you can add on click listner to any of your view i.e.
yourView.setonClickListener(this);(new OnClickListener() {
#Override
public void onClick(View v) {
// Close dialog
dialog.dismiss();
}
});
I have a custom dialog preference that have bunch of button.each button represent a number.something like clock application when you want to set alarm. how can I get onClick of each button in my dialog preference?
this is part of my dialog layout (time_picker) :
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center">
<LinearLayout
android:id="#+id/showTimer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
>
<TextView
android:id="#+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:text="_ _ : _ _"
android:textSize="20dp"
android:textStyle="bold" />
</LinearLayout>
<RelativeLayout
android:id="#+id/Buttons"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:layout_below="#+id/showTimer"
android:layout_marginTop="10dp">
<Button
android:id="#+id/button1"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:layout_alignBaseline="#+id/button5"
android:layout_alignBottom="#+id/button5"
android:layout_alignLeft="#+id/button3"
android:layout_centerInParent="true"
android:text="6"
android:textStyle="bold"
android:textSize="20dp"
android:tag="1"
android:background="#android:color/transparent" />
<Button
android:id="#+id/button2"
android:layout_width="100dp"
...
this is Setting layout that launch dialog preference:
<com.example.test.TimerForNoti
android:key = "pref_sync_noti_timer"
android:title = "#string/pref_sync_noti_timer"
android:summary = "#string/pref_sync_noti_timer_summ"
android:dialogMessage = "#string/pref_sync_noti_timer">
</com.example.test.TimerForNoti>
and this is class of dialog preference (TimerForNoti) :
public class TimerForNoti extends DialogPreference
{
public TimerForNoti(Context context, AttributeSet attrs) {
super(context, attrs);
setDialogLayoutResource(R.layout.time_picker);
setPositiveButtonText(R.string.ok);
setNegativeButtonText(R.string.cancel);
Dialog di = new Dialog(context);
di.setContentView(R.layout.time_picker);
OnClickListener test = new OnClickListener() {
#Override
public void onClick(View v) {
// TODO Auto-generated method stub
String tag = v.getTag().toString();
if(tag == "1"){
Log.v("onOne", "ok");
}
// .....
}
};
Button btn1 = (Button) di.findViewById(R.id.button1);
btn1.setOnClickListener(test);
}
}
If I understand your question right, you can set tag for each button and set one OnClickListener for all of them:
<Button
android:id="#+id/button1"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:layout_alignBaseline="#+id/button5"
android:layout_alignBottom="#+id/button5"
android:layout_alignLeft="#+id/button3"
android:layout_centerInParent="true"
android:text="6"
android:textStyle="bold"
android:textSize="20dp"
android:tag="6"
android:background="#android:color/transparent" />
Code:
OnClickListener buttonsListener = new OnClickListener() {
#Override
public void onClick(View v) {
String buttonText = v.getTag().toString();
// your logic here
}
};
Button btn1 = (Button)findViewById(R.id.button1);
btn1.setOnClickListener(buttonsListener);
Button btn2 = (Button)findViewById(R.id.button2);
btn2.setOnClickListener(buttonsListener);
Button btn3 = (Button)findViewById(R.id.button3);
btn3.setOnClickListener(buttonsListener);
// your buttons here
Also you can use v.getId() in OnClickListener for determining which button was clicked
As much I understood your question. You want one method to be called on every button clicked.
For that Add this to your every button element in xml:
<Button
android:onClick="OnClick"
.. />
And this method to your .java file where you want to perform task:
public void OnClick(View v){
// do something....
}
Or you can directly call setOnClickListener at button object
button.setOnClickListener(new OnClickListener() {
#Override
public void onClick(View arg0) {
// do something....
}
});
I have MainActivity where I've got a button which opens a dialog. Once I click this button, I have my dialog frame opened, and now I have two text fields in this dialog and two buttons.
How do I change the text in that field by clicking one of those buttons?
I was trying some tricks, but I've always got NullPointerException.
Thanks in advance!
I would use a custom dialog.
You need to use dialog object to findViewById and initialize views.
dialog.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<Button
android:id="#+id/button2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="#+id/button1"
android:layout_alignBottom="#+id/button1"
android:layout_alignParentRight="true"
android:layout_marginRight="58dp"
android:text="Cancel" />
<EditText
android:id="#+id/ed1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/textView1"
android:layout_marginTop="56dp"
android:layout_toLeftOf="#+id/button2"
/>
<EditText
android:id="#+id/ed2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/textView2"
android:layout_alignParentTop="true"
android:layout_marginTop="16dp"
/>
<Button
android:id="#+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignRight="#+id/textView2"
android:layout_below="#+id/textView2"
android:layout_marginRight="27dp"
android:layout_marginTop="39dp"
android:text="ChangeText" />
</RelativeLayout>
Then in your activity say on button click
dialogPopup();
Then
public void dialogPopup()
{
final Dialog d = new Dialog(MainActivity.this); // initialize dialog
d.setContentView( R.layout.dialog);
d.setTitle("my title");
final EdiText ed1= (TextView) d.findViewById(R.id.ed1);
// initialize edittext using the dialog object.
final EdiText ed2= (TextView) d.findViewById(R.id.ed2);
Button b = (Button) d.findViewById(R.id.button1);
b.setOnClickListener(new OnClickListener() // button 1 click
{
#Override
public void onClick(View v) {
// TODO Auto-generated method stub
// on click of button 1 change the text in textview's
ed1.setText("Changing text 1");
ed2.setText("Changing text 2");
}
});
Button b1 = (Button) d.findViewById(R.id.button2); // button2 click
b1.setOnClickListener(new OnClickListener()
{
#Override
public void onClick(View v) {
// TODO Auto-generated method stub
d.dismiss(); // dismiss dialog
}
});
d.show(); // show the dialog
}
When you create the dialog with AlertDialog.Builder, set the Button's onClickListener to change the EditText's value:
AlertDialog.Builder dialog = new AlertDialog.Builer(this);
...
final EditText edit = new EditText(this);
dialog.setView(edit);
...
dialog.setPositiveButton("Change the freakin text",new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog,int id){
edit.setText("bla bla bla");
}
});
...
I want to create a different theme for all of alertDialog instances. I need my own title view instead of the usual black title background. All text should have a blue color, and set the edge of the alertDialog to a round shape.
Is it possible to create our own theme for alert dialogs, using any style or creating a class which extends AlertDialog.Builder? I need a common theme or style for my all instances of alertDialog. I am using alertDialog in many places - one for singleChoice items, one with ArrayAdapter.
My alertDialog with array adapter:
String[] items = {"Edit profile","Change user","Change password","Logout"};
ArrayAdapter<String> adapter = new ArrayAdapter<String>(Loged.this,
R.layout.my_spinner_layout, items);
settingMenu.setAdapter(adapter, listener);
My alertDialog with single choice items:
alertDelete = new AlertDialog.Builder(getParent());
alertDelete.setTitle("Delete");
alertDelete.setCancelable(true);
CharSequence[] choice = {"this user","All user"};
alertDelete.setSingleChoiceItems(choice, 0,
For my all alertDialog, I need a common theme, like:
please check this link. here am creating my own alertDialog class
and its a simple method if you reuse the alertDialog in many situation in your application
how Create setAdapter() for a AlertDialog
I solved my problem by creating a class which extends Dialog, and I created my own functions. for example setMessage,setTitle,setPositiveButton,setNegativeButton etc.
But am confusing on how we can replace the setAdapter() and setSingleChoice().
Here one example For Dialog:
button = (Button) findViewById(R.id.button1);
button.setOnClickListener(new OnClickListener() {
#Override
public void onClick(View arg0) {
// custom dialog
final Dialog dialog = new Dialog(context);
dialog.setContentView(R.layout.custom);
dialog.setTitle("Give a Title...");
// set the custom dialog components - text, image and button
TextView text = (TextView) dialog.findViewById(R.id.text);
text.setText("Put here any custom text!");
ImageView image = (ImageView) dialog.findViewById(R.id.image);
image.setImageResource(R.drawable.ic_launcher);
Button dialogButton = (Button) dialog.findViewById(R.id.ButtonOK);
// if button is clickedthen dialog will closed
dialogButton.setOnClickListener(new OnClickListener() {
#Override
public void onClick(View v) {
dialog.dismiss();
}
});
dialog.show();
}
});
Custom AlertDialog
AlertDialog.Builder builder;
AlertDialog alertDialog;
Context mContext;
LayoutInflater inflater = (LayoutInflater)mContext.getSystemService(LAYOUT_INFLATER_SERVICE);
View urlayoutfile = inflater.inflate(R.layout.custom_dialog_xmlfile,(ViewGroup)findViewById(R.id.Yourlayout_id));
builder = new AlertDialog.Builder(this);
builder.setView(urlayoutfile);
alertDialog = builder.create();
alertDialog.show();
To use a specific style, use
ctw = new ContextThemeWrapper(this, R.style.MyStyle);
new AlertDialog.Builder(ctw)
.setTitle(...)
You can use layout as Different themes, styles, Backgrounds
customdialog.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/relativeLayout1"
style="#android:style/Theme.Black.NoTitleBar.Fullscreen"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<LinearLayout
android:id="#+id/layoutsample"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:orientation="vertical" >
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#drawable/dialoghdrbg"
android:orientation="horizontal" >
<ImageView
android:id="#+id/dialogheaderimage1"
android:layout_width="50dp"
android:layout_height="48dp"
android:scaleType="fitXY"
/>
<TextView
android:id="#+id/dialogheadertext1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical|right"
android:layout_marginLeft="1dp"
android:gravity="center_vertical|right"
android:textColor="#000000"
android:textSize="25dp"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#drawable/dialogcontentbg"
android:orientation="vertical" android:gravity="center">
<TextView
android:id="#+id/dialogmessgetext1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:textColor="#ffffff"
android:textSize="23dp"
android:text=""
android:gravity="center"
/>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center|center_horizontal"
android:gravity="center|center_horizontal"
android:layout_marginTop="20dip"
android:orientation="horizontal">
<Button
android:id="#+id/dialogokbutton1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="15dp"
android:background="#drawable/buttonanimation"
android:text="Retry"
android:textSize="20dp"
android:textStyle="bold" />
<Button
android:id="#+id/dialogcancelbutton1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="15dp"
android:background="#drawable/buttonanimation"
android:text="Report"
android:textSize="20dp"
android:textStyle="bold" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</RelativeLayout>
customDialog.java
final Dialog favDialog = new Dialog(Myclass.this,
android.R.style.Theme_Translucent_NoTitleBar_Fullscreen);
favDialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
favDialog.getWindow().setFlags(
WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
favDialog.setContentView(R.layout.reloadurlpopuplayout);
favDialog.setCancelable(false);
ImageView dialogImage = (ImageView) favDialog
.findViewById(R.id.dialogheaderimage1);
dialogImage.setBackgroundResource(R.drawable.questionmark);
TextView dialogMesage = (TextView ) favDialog
.findViewById(R.id.dialogmessgetext1);
TextView dialogHeader = (TextView) favDialog
.findViewById(R.id.dialogheadertext1);
String descText = getString(R.string.RetryReportMessage);
dialogMesage.setBackgroundColor(0x00000000);
dialogMesage.setText(descText);
dialogHeader.setText(R.string.BrockenLinkHeader);
try {
favDialog.show();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}