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
priyanka tandelPosted Apr 26, 2017, 4:47 AM
Anbu ManiPosted Apr 26, 2017, 4:09 AM
Cool..Nope..
{
{
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();
}
priyanka tandelPosted Apr 26, 2017, 3:52 AM
{
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();
}
}
priyanka tandelPosted Apr 26, 2017, 3:44 AM
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();
Anbu ManiPosted Apr 26, 2017, 3:18 AM
Anbu ManiPosted Apr 26, 2017, 3:13 AM
priyanka tandelPosted Apr 26, 2017, 3:11 AM
//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"));
}
priyanka tandelPosted Apr 26, 2017, 3:07 AM
{
signup.Dismiss();
Dialogclass signup = new Dialogclass();
signup.Show(transcation, "Dialog Fragment");
Anbu ManiPosted Apr 26, 2017, 2:09 AM
//create and show the dialog
Dialogclass signup = new Dialogclass();
priyanka tandelPosted Apr 26, 2017, 2:00 AM
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
Anbu ManiPosted Apr 25, 2017, 12:25 AM
Dialogclass signup = new Dialogclass();
signup.Show(transcation, "Dialog Fragment"); in main activity
{
Toast.MakeText(Activity, "THANKS FOR UR FEEDBACK!", ToastLength.Short).Show();
signup.Dismiss();
};