[mono-android] ActionBarSherlock
Atsushi Eno
atsushieno at veritas-vos-liberabit.com
Fri Oct 12 08:45:56 UTC 2012
That rather sounds like your class misses some required callback class
that Java code requires in certain name, and your Tab implementation
needs to use ExportAttribute which was introduced in MfA 4.2 (actually
4.1 preview).
I wanted to point to our documentation, but it seems our doc team
somehow removed it [*1], so I put a copy of my draft doc as a quick
workaround:
https://docs.google.com/document/d/1BYPN8V6atJz63UBnqvSmuF9nV_8YnuA1dopSVSHr_44/edit
For the API details, see
http://androidapi.xamarin.com/?link=T:Java.Interop.ExportAttribute
[*1]
http://docs.xamarin.com/android/advanced_topics/ExportAttribute%3A_onClick,_Serializable,_Parcelable.CREATOR
Atsushi Eno
craig wrote:
> I found a bug in the action bar binding...
>
> If you take the sample app
> (https://github.com/xamarin/monodroid-samples/tree/master/ActionBarSherlock)
> and try to implement tabs then you will get an error message:
>
> "Action Bar Tab must have a Callback"
>
> Below is a code snippet of what I am trying to do.
>
> I'm basically just following the example outlined on the android site
> (http://developer.android.com/guide/topics/ui/actionbar.html) under the
> heading Adding Navigation Tabs, and substituting any standard classes for
> the Sherlock classes or Support classes. I have tried the exact same code
> converted to Java and using the standard Android API and it works fine, but
> unfortunately a bug exists in Mono or the Mono JAR binding.
>
> Below is a short snippet of what I am trying to accomplish:
>
> public class TabActivity : SherlockFragmentActivity
> {
> protected override void OnCreate(Bundle bundle)
> {
> base.OnCreate(bundle);
> SetContentView(Resource.Layout.main);
>
> ActionBar actionBar = SupportActionBar;
> actionBar.NavigationMode = (int)ActionBarNavigationMode.Tabs;
> actionBar.SetDisplayShowTitleEnabled(false);
>
> Tab tab = actionBar.NewTab();
> tab.SetTag("test");
> TabListener listener = new TabListener(this, "test",
> typeof(TestFragment));
> tab.SetTabListener(listener);
> *actionBar.AddTab(tab); //ERROR OCCURS ON THIS LINE*
> }
> }
>
>
>
> --
> View this message in context: http://mono-for-android.1047100.n5.nabble.com/ActionBarSherlock-tp5710482p5712159.html
> Sent from the Mono for Android mailing list archive at Nabble.com.
> _______________________________________________
> Monodroid mailing list
> Monodroid at lists.ximian.com
>
> UNSUBSCRIBE INFORMATION:
> http://lists.ximian.com/mailman/listinfo/monodroid
>
>
>
More information about the Monodroid
mailing list