Button Clicked event never triggers for Android 7

Hi there
My code for hitting the button works fine for Android 6 device, but Clicked never triggers for Android 7.0. Code:

Button btn = new Button();
AddControl(btn);
if (String.IsNullOrEmpty(title)) btn.Text = "Dates"; else btn.Text = title;

        object o = new SSCApp.Classes.FontSizeConverter().Convert(12, typeof(int), null, System.Globalization.CultureInfo.CurrentCulture);
        btn.FontSize = (int)o;
        if (clickAction!=null)
            btn.Clicked += (s, e) => 
            {
                clickAction();
            };

public void AddControl(View _view)
{
InlineContainer.Children.Add(_view);
RaiseChild(_view);
}

InlineContainer is just a StackLayout. What can be a reason Click is not triggering?
Thanks.

Posts

  • JulienRosenJulienRosen CAMember ✭✭✭✭
    edited December 2017

    edit: i am dumb

  • NickRenzhiglovNickRenzhiglov CAMember ✭✭

    The place is right. The project is Xamarin Forms. The Start-up Project is app.Droid.
    Thoughts?

  • JulienRosenJulienRosen CAMember ✭✭✭✭
    edited December 2017

    edit: am still dumb

  • NickRenzhiglovNickRenzhiglov CAMember ✭✭

    JulienRosen, my code sample is the C# code and what is the "android code" I do not know.
    Anyway, I am not in the position to debate it.
    If you have anything to answer in essence, I'm eager to listen to it.
    Thanks.

  • JulienRosenJulienRosen CAMember ✭✭✭✭
    edited December 2017

    edit: still dumb

  • NickRenzhiglovNickRenzhiglov CAMember ✭✭

    Well...
    Maybe I expressed myself in a vague way. I have a Xamarin Forms project. I am not talking about the Xamarin Android here. All I deal with is the Xamarin Forms project. All right.

    If I set iOS as a start project, it works for iPhone version from 9 to 11.
    If I set the Android as a start project it works for version 6, but not for 7.
    Any clue why it is happening?
    Thanks.

  • NickRenzhiglovNickRenzhiglov CAMember ✭✭

    It is fixed, but this was crazy. The container grid had declaration Grid.RowSpan="2" which was redundant. As soon as I removed that, it begun working for all platforms/versions. So touch and go stuff.

    To JulienRosen:

    i am dumb

    Of course, you are. But please do not use my threads for your stupid copping of plea

  • JulienRosenJulienRosen CAMember ✭✭✭✭

    Of course, you are. But please do not use my threads for your stupid copping of plea

    well, here's one person i'll never try and help again

  • NickRenzhiglovNickRenzhiglov CAMember ✭✭

    Yes, please. I'm sorry to see you are taking the offence, but no help like this for me.
    I do not want the trolling people to write to my threads.
    I appreciate.

Sign In or Register to comment.