Forum Xamarin.Android

Intent.GetStringExtra("OriginName") Unknown member: GetStringExtra(Pass data one-anthoer activity )

I have following code

var shipmentDetailActivity = new Intent(this, typeof(ShipmentDetailActivity));

        shipmentDetailActivity.PutExtra("OriginName", sd.OriginName);
        shipmentDetailActivity.PutExtra("DestinationName", sd.DestinationName);
        shipmentDetailActivity.PutExtra("PostalCode", sd.DestinationPhone);
        shipmentDetailActivity.PutExtra("State", sd.ShipmentCategory);
        shipmentDetailActivity.PutExtra("Country", sd.DestinationAddress);
        StartActivity(shipmentDetailActivity);

in my ScanActivity class and tried to pass these values to pass another activity called ShipmentDetailActivity as below

           var originName = Intent.GetStringExtra("OriginName") ?? string.Empty;
            var destinationName = Intent.GetStringExtra("DestinationName") ?? string.Empty;
            var postalCode = Intent.GetStringExtra("PostalCode") ?? string.Empty;
            var state = Intent.GetStringExtra("State") ?? string.Empty;
            var country = Intent.GetStringExtra("Country") ?? string.Empty;

but im receiving Unknown member: GetStringExtra error. while typing intellisense shows this method as suggestion but when run this im getting this error.

HOw to verify PutExtra key,value pair in quick watch visual studio.is there any property to verify that?
And am i missing anything else?

Answers

  • ManirajSManirajS USMember

    It has been worked.I was trying assign int to string. Now i changed as ToString() with properties;

Sign In or Register to comment.