locked
Fragment GetActivity RRS feed

  • Question

  • User164819 posted

    Hi, I ran into problem with fragment .. I get through the xamarin guides, stackoverflow etc., but havent find any acceptable solution.

    I need to show a Toast from inside the fragment, but as it seems to be, there is no GetActivity() in c# Any solutions I have found, was for java :(

    Toast.MakeText( /GET ACTIVITY IN WHICH IS FRAGMENT HERE/, "OK", ToastLength.Long).Show();

    Any help please?

    Tuesday, November 3, 2015 10:13 AM

Answers

  • User52634 posted

    @Zorak Toast.MakeText(this.Activity,"OK",ToastLength.Long).Show();

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Tuesday, November 3, 2015 10:41 AM

All replies

  • User52634 posted

    @Zorak Toast.MakeText(this.Activity,"OK",ToastLength.Long).Show();

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Tuesday, November 3, 2015 10:41 AM
  • User164819 posted

    Works great, thanks a lot :)

    Wednesday, November 4, 2015 7:06 AM
  • User308149 posted

    @ashalva said: @Zorak Toast.MakeText(this.Activity,"OK",ToastLength.Long).Show();

    Thank you its very nice !

    Friday, April 28, 2017 2:38 PM
  • User342721 posted

    @ashalva said: @Zorak Toast.MakeText(this.Activity,"OK",ToastLength.Long).Show();

    Thanks for this! :smile:

    Friday, October 13, 2017 4:10 PM