dismiss method is is not working on single button click in xamarin android i have created
F FragmentTransaction transcation = FragmentManager.BeginTransaction();
Dialogclass signup = new Dialogclass();
signup.Show(transcation, "Dialog Fragment"); in main activity
Dialogclass signup = new Dialogclass();
signup.Show(transcation, "Dialog Fragment"); in main activity
then i created dialogue.cs class
close.Click += delegate
{
Toast.MakeText(Activity, "THANKS FOR UR FEEDBACK!", ToastLength.Short).Show();
Dismiss();
}; is not working on single click
{
Toast.MakeText(Activity, "THANKS FOR UR FEEDBACK!", ToastLength.Short).Show();
Dismiss();
}; is not working on single click

Anbu ManiRank #206 · 11.7K reputationPosted Apr 24, 2017, 8:25 PM EDT
Dialogclass signup = new Dialogclass();
signup.Show(transcation, "Dialog Fragment"); in main activity
{
Toast.MakeText(Activity, "THANKS FOR UR FEEDBACK!", ToastLength.Short).Show();
signup.Dismiss();
};
Anbu ManiRank #206 · 11.7K reputationPosted Apr 25, 2017, 10:09 PM EDT
//create and show the dialog
Dialogclass signup = new Dialogclass();
priyanka tandel37 reputationPosted Apr 25, 2017, 11:07 PM EDT
{
signup.Dismiss();
Dialogclass signup = new Dialogclass();
signup.Show(transcation, "Dialog Fragment");
priyanka tandel37 reputationPosted Apr 25, 2017, 11:11 PM EDT
//sharing implementation here
Intent sharingIntent = new Intent(Android.Content.Intent.ActionSend);
sharingIntent.SetFlags(ActivityFlags.ClearTask);
sharingIntent.SetType("text/plain");
String shareBody = "Here is the share content body";
sharingIntent.PutExtra(Android.Content.Intent.ExtraSubject, "Subject Here");
sharingIntent.PutExtra(Android.Content.Intent.ExtraText, shareBody);
StartActivity(Intent.CreateChooser(sharingIntent, "Share via"));
}
Anbu ManiRank #206 · 11.7K reputationPosted Apr 25, 2017, 11:13 PM EDT
Anbu ManiRank #206 · 11.7K reputationPosted Apr 25, 2017, 11:18 PM EDT
priyanka tandel37 reputationPosted Apr 25, 2017, 11:44 PM EDT
AlertDialog.Builder builder = new AlertDialog.Builder(Activity);
Dialog dialog = builder.Create();
builder.SetPositiveButton("Delete", (senderAlert, args) => {
builder.SetNegativeButton("Cancel", (senderAlert, args) => {
Toast.MakeText(Activity, "Cancelled!", ToastLength.Short).Show();
builder.Dispose();
});
return builder.Create();
priyanka tandel37 reputationPosted Apr 25, 2017, 11:52 PM EDT
{
navigationView.NavigationItemSelected += (sender, e) =>
{
e.MenuItem.SetChecked(true);
if (e.MenuItem.ItemId == Resource.Id.Feddback)
{
// this.Finish();
StartActivity(typeof(feedbck));
}
else if (e.MenuItem.ItemId == Resource.Id.Share)
{
shareIt();
}
else if (e.MenuItem.ItemId == Resource.Id.rateapp)
{
FragmentTransaction transcation = FragmentManager.BeginTransaction();
//create and show the dialog
Dialogclass signup = new Dialogclass();
signup.Show(transcation, "Dialog Fragment");
// transcation.Hide(signup).Commit();
// alert.SetTitle("Confirm delete");
}
else if (e.MenuItem.ItemId == Resource.Id.Levels)
{
StartActivity(typeof(selectlevl));
}
else if (e.MenuItem.ItemId == Resource.Id.notification)
{
StartActivity(typeof(Notifications));
}
else if (e.MenuItem.ItemId == Resource.Id.exit)
{
interstitialAds = new InterstitialAd(this);//intial add
var adrequest = new AdRequest.Builder().Build();
interstitialAds.AdUnitId = "ca-app-pub-3940256099942544/1033173712";
interstitialAds.LoadAd(adrequest);
interstitialAds.AdListener = new AdListener(this);
// Finish();
}
{
public override Dialog OnCreateDialog(Bundle savedInstanceState)
{
AlertDialog.Builder builder = new AlertDialog.Builder(Activity);
Dialog dialog = builder.Create();
builder.SetPositiveButton("Delete", (senderAlert, args) => {
Toast.MakeText(Activity, "Deleted!", ToastLength.Short).Show();
});
builder.SetNegativeButton("Cancel", (senderAlert, args) => {
Toast.MakeText(Activity, "Cancelled!", ToastLength.Short).Show();
builder.Dispose();
});
return builder.Create();
}
}
Anbu ManiRank #206 · 11.7K reputationPosted Apr 26, 2017, 12:09 AM EDT
Cool..Nope..
{
public static Dialogclass Instance(Bundle bundle){ Dialogclass fragment = new Dialogclass (); fragment.Arguments = bundle; return fragment; }{
AlertDialog.Builder builder = new AlertDialog.Builder(Activity);
Dialog dialog = builder.Create();
builder.SetPositiveButton("Delete", (senderAlert, args) => {
Toast.MakeText(Activity, "Deleted!", ToastLength.Short).Show();
});
builder.SetNegativeButton("Cancel", (senderAlert, args) => {
Toast.MakeText(Activity, "Cancelled!", ToastLength.Short).Show();
});
return builder.Create();
}
Dialogclass newFragment = Dialogclass.Instance(null);priyanka tandel37 reputationPosted Apr 26, 2017, 12:47 AM EDT
priyanka tandel37 reputationPosted Apr 25, 2017, 10:00 PM EDT
FragmentTransaction transcation = FragmentManager.BeginTransaction();
//create and show the dialog
Dialogclass signup = new Dialogclass();
{
public static Dialogclass NewInstance(Bundle bundle)
{
Dialogclass fragment = new Dialogclass();
fragment.Arguments = bundle;
return fragment;
}
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
{
base.OnCreateView(inflater, container, savedInstanceState);
var view = inflater.Inflate(Resource.Layout.Rate_app, container, false);
Button happy = view.FindViewById