Bug 2438 - ListActivity empty view resource id gen fails with required id "@android:id/list"
Summary: ListActivity empty view resource id gen fails with required id "@android:id/l...
Status: RESOLVED INVALID
Alias: None
Product: Android
Classification: Xamarin
Component: General ()
Version: 4.0
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2011-12-09 08:03 UTC by Peter Davis
Modified: 2011-12-09 08:35 UTC (History)
1 user (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED INVALID

Description Peter Davis 2011-12-09 08:03:57 UTC
Working through Android in Action and learning the C# API's at the some time, and believe I have hit an issue.

I am trying to set the empty view of a list view based on the following Java code from the OnCreate of a ListActivity

       this.empty = (TextView) findViewById(R.id.empty);

        // set list properties
        final ListView listView = getListView();
        listView.setItemsCanFocus(false);
        listView.setChoiceMode(ListView.CHOICE_MODE_SINGLE);
        listView.setEmptyView(this.empty);

The issues is that the documentation states that a empty view must have an id of "@android:id/list" (http://developer.android.com/reference/android/app/ListActivity.html) 
 and when this id is used on a TextView no code is generated in the Resource.Id class.

The corresponding C# has the following error:

Error CS0117: `Chapter3.Resource.Id' does not contain a definition for `empty' 

        this.empty = FindViewById<TextView> (Resource.Id.empty);
            
        // Set list properties
        var listView = this.ListView;
        listView.ItemsCanFocus = false;
        listView.ChoiceMode = ChoiceMode.Single;
        listView.EmptyView = this.empty;

Full java source is from chapter 3 here: http://code.google.com/p/android-in-action/
Comment 1 Peter Davis 2011-12-09 08:35:54 UTC
Sorry, finally found what I was doing wrong.