actionbarsherlock

MediaRouter: Detecting a chromecast device when using ActionBarSherlock?

依然范特西╮ 提交于 2019-12-13 18:38:16
问题 So I modified the Mediarouter source to be dependent on ActionBarSherlock rather than AppCompat. However, now the callback from MediaRouteAdapter onDeviceAvailable(...) is not being called. Any ideas on how to get this to work? I don't want to leave the cast button always visible. Rather, I want to use onDeviceAvailable(..) to only make it visible when a device is available. 回答1: I found a hack on how to fix this. If you use appcompat, the cast icon will only be visible when you have a

ActionBarSherlock and custom TextBox (extends AutoCompleteTextView)

时光毁灭记忆、已成空白 提交于 2019-12-13 14:51:43
问题 OK, I'm going crazy over this - I've integrated ActionBarSherlock in my app and am using Theme.Sherlock. Now, I can't seem to get my custom textbox to work properly - whenever I leave textbox, text becomes white. Here is image to better explain the problem (I've used Overlay layout from examples that come with the library): Typing: Going back to EditText: Does anyone have idea why this is happening? EDIT: To reproduce this error simply download the ActionBar zip and extract sample project.

Styling sherlock ActionMode background

為{幸葍}努か 提交于 2019-12-13 14:01:05
问题 Can't seem to style the ActionMode background. I've already overridden actionbar background but setting the ActionMode background doesn't seem to work: <style name="Theme.apptheme" parent="@style/Theme.Sherlock.Light.DarkActionBar"> ... <item name="actionBarStyle">@style/Widget.Styled.ActionBar</item> <item name="actionModeBackground">@drawable/actionmode_background</item> <item name="actionModeSplitBackground">@drawable/actionmode_split</item> ... </style> Any idea how to accomplish this?

Animators may only be run on Looper threads on Sherlock Action Bar

倾然丶 夕夏残阳落幕 提交于 2019-12-13 12:24:38
问题 I wanted to hide the action bar after the 1 second delay, Timer().schedule(new TimerTask() { @Override public void run() { getSupportActionBar().hide(); } }, 1000); Getting crash after I ran the code.. android.util.AndroidRuntimeException: Animators may only be run on Looper threads Is there any solution for this issue? Thanks. 回答1: Solved it by using new Handler().postDelayed(new Runnable() { @Override public void run() { getSupportActionBar().hide(); } }, 1000); 来源: https://stackoverflow

My Android app's singleton gets re-initialized while app is running

蓝咒 提交于 2019-12-13 07:52:15
问题 I searched for 2-3 days a solution to my problem, but i haven't found anyone who had a similar problem. Basically, my app is the "mobile version" of a web site, so I have to store temporally different account's informations, so I used a signleton class, call it "user". Yet while navigationg through certain 2 activities (in one I have an expandable list and in the the other a listview , like you have a cart (1st activity) to substitute its empty spaces with elements from the "shop" (2nd

in Actionbar sherlock, add tab throw: commit already called

烈酒焚心 提交于 2019-12-13 07:08:13
问题 I'm trying to use ActionBarSherlock for tab view in android. It's only a demo project with 3 tabs, each tab just show a fragment which contains a textview. This is my MainActivity code: public class MainActivity extends SherlockFragmentActivity { private ActionBar mActionBar; private Tab tab1; private Tab tab2; private Tab tab3; @Override protected void onCreate(Bundle arg0) { super.onCreate(arg0); setContentView(R.layout.activity_main); mActionBar = getSupportActionBar(); mActionBar

actionbar sherlock tabs with spinner and .setOnItemSelectedListener(this)

前提是你 提交于 2019-12-13 06:45:33
问题 I would like to use the tab navigation on actionbarsherlock and I have a spinner in one of the tab layouts. My Problem is: the .setOnItemSelectedListener() for the spinner is never called. what I am doing wrong? BtW. the array adapter does not fill in the items, I must put <Spinner android:id="@+id/sp" android:layout_width="wrap_content" android:layout_height="wrap_content" android:entries="@array/Types" /> attached the class: import android.content.res.Configuration; import android.os.Bundle

Android app crashing on startActivity

一笑奈何 提交于 2019-12-13 06:19:26
问题 I have a ListView and when a row is pressed I want to start a new activity. The list view is in a Fragment display in a tab. The code I'm using to display the activity is: @Override public void onListItemClick(ListView l, View v, int position, long id) { Intent intent = new Intent(mView.getContext(), SessionActivity.class); startActivity(intent); } When I run the code the new activity is displayed but the app immediately crashes. This is what I get in the log: 05-11 15:05:08.504: I/Process

onMenuItemClick doesn't get called

烂漫一生 提交于 2019-12-13 05:47:51
问题 I am using NavigationDrawer with ActionBarSherlock. When I click on menu items onMenuItemClick() methods don't get called. The code: @Override public boolean onOptionsItemSelected(MenuItem item) { if (item.getItemId() == android.R.id.home) { if (mDrawerLayout.isDrawerOpen(mDrawerList)) { mDrawerLayout.closeDrawer(mDrawerList); } else { mDrawerLayout.openDrawer(mDrawerList); } } return super.onOptionsItemSelected(item); } @Override public boolean onPrepareOptionsMenu(Menu menu) { boolean

Retrieve the id of a selected list item from a sqlite database

安稳与你 提交于 2019-12-13 05:33:15
问题 i try to call an other activity that use data from the current activity when i click on a listItem. but there are errors in my code. How to fix it? line 105: SQLiteCursor cr=(SQLiteCursor)parent.getItemAtPosition(position); ListAnSco.java public class ListAnSco extends SherlockActivity{ protected EditText searchText; DatabaseHelper dbhelper; SQLiteDatabase db; protected Cursor cursor; ListAdapterAnSco adapter; private static ListView liste; TextView ansco; String [] from; int to[]; @Override