Why Resource.Designer.cs delete my definiton?

Hi everyone,

When I add a TitleActivityLayout1.axml layout file to layout folder, My definition "details" is deleted from Resource.Designer.cs automatically.

And I can not use it in my code anymore as : Resource.Id.details

Is this a bug or my mistake?

Resource.Designer.cs

        // aapt resource value: 0x7f07006a
        public const int details = 2131165290;

Resources/layout/TitleActivityLayout1.axml

<?xml version="1.0" encoding="utf-8"?>



TitleActivity.cs (TitleActivity : Activity)

     var details = TitlesFragment.NewInstance(index); // Details
     var fragmentTransaction = FragmentManager.BeginTransaction();
     fragmentTransaction.Add(Android.Resource.Id.Content, details);
     fragmentTransaction.Commit();

TitlesFragment.cs (TitlesFragment : ListFragment)

public static TitlesFragment NewInstance(int toplulukId)

        _toplulukId = toplulukId;
        var detailsFrag = new TitlesFragment { Arguments = new Bundle() };
        detailsFrag.Arguments.PutInt("_current_user_id", toplulukId);           
        return detailsFrag;  // for details

public async override void OnActivityCreated(Bundle savedInstanceState)

        base.OnActivityCreated(savedInstanceState);           

        var detailsFrame = Activity.FindViewById<View>(Resource.Id.details);  //  Here I use details that is an instance of TitleFragment 

What is wrong here???

Answers

  • Dada.8083Dada.8083 USMember

    The Resource.Designer.cs file is autogenerated. So everytime you build your application it gets deleted and recreated.
    Your TitleActivityLayout1.axml seems empty?

Sign In or Register to comment.