actionbarsherlock

How To show icons in Overflow menu in ActionBar

不问归期 提交于 2019-12-17 02:28:28
问题 I know it's not possible using the native API. Is there a workaround to implement that kind of view? 回答1: The previously posted answer is OK, generally speaking. But it basically removes the default behaviour of the Overflow menu. Things like how many icons can be displayed on different screen-sizes and then they dropped off into the overflow menu when they can't be displayed. By doing the above you remove a lot of important functionality. A better method would be to tell the overflow menu to

Android Viewpager as Image Slide Gallery

只愿长相守 提交于 2019-12-17 02:25:53
问题 I am using Jake's ViewPageIndicator and want to display Images like a swipe gallery. Any refernce link where i can get started. I have implemented the basic viewpager and now want to implement image viewpaper as below Is it possible to to achieve using ViewPageIndicator ? 回答1: In Jake's ViewPageIndicator he has implemented View pager to display a String array (i.e. ["this","is","a","text"] ) which you pass from YourAdapter.java (that extends FragmentPagerAdapter) to the YourFragment.java

外部JAR上的“到Dalvik格式的转换失败,错误1”

别等时光非礼了梦想. 提交于 2019-12-15 20:54:18
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 在Eclipse中的Android应用程序中,出现以下错误。 超出预期的最高级别: java.lang.IllegalArgumentException:已添加:Lorg / xmlpull / v1 / XmlPullParser; .... 转换为Dalvik格式失败,错误1 仅当我向项目中添加特定的外部JAR文件时,才会出现此错误。 我搜索了很长时间以寻找可能的解决方案,但是所有可能的解决方案都无效。 我什至尝试更改为Android 1.6而不是1.5(我使用的当前版本)。 #1楼 我发现了其他东西。 Android使用 /libs 目录存储JAR文件。 我无数次看到“向Dalvik格式转换失败并出现错误1”错误,总是在我的JAR文件中出现错误时出现。 现在,通过将新的JAR文件放在 /libs 目录中,并将类路径切换到新版本,我将Roboguice升级到了新版本。 这导致了Dalvik错误。 当我从 /libs 文件夹中删除Roboguice JAR文件之一时,错误消失了。 显然,Android会从 /libs 拾取所有JAR文件,无论您在Java构建路径中指定了哪个文件。 我记不清了,但是我认为Android默认从 Android 4.0 (Ice Cream Sandwich,ICS)开始使用

searchview not closing correctly on FIRST back press (it's only loosing focus)

时光总嘲笑我的痴心妄想 提交于 2019-12-14 04:16:50
问题 I have to press the backbutton twice, to close the SearchView . Why? On the first press, the SearchView only looses focus... Setting setOnKeyListener on SearchView does not work either... Btw, I'm using the ABS implementation... My code is simple and looks like the following: mMenuItemSearch = menu.findItem(R.id.search); mSearchView = new SearchView(getSupportActionBar().getThemedContext()); mMenuItemSearch.setActionView(mSearchView); mSearchView.setOnQueryTextListener(new SearchView

How to remove the Activity title from Action Bar Sherlock without losing it from the 'RecentApps' chooser?

梦想与她 提交于 2019-12-14 03:59:52
问题 I am having problems trying to remove the Activity title text from my Action Bar Sherlock . I have spent(wasted) a lot of time trying to find a solution and just cannot make this work. I have a Splash Activity on which I go full screen. But just before the Splash Activity appears, a screen appears (for a very short period of time) that has nothing but an Action Bar with the App Icon and Activity Title Text. I do not understand why it appears. Is this default Android behavior? I want to avoid

Android: How to unfocus a SearchView programmatically

拜拜、爱过 提交于 2019-12-14 03:54:26
问题 I have a SearchView in my layout (not in the action bar) and I'm unable to dismiss the keyboard using the usual method: public static void hideKeyboard(Activity activity) { InputMethodManager imm = (InputMethodManager)activity .getSystemService(Context.INPUT_METHOD_SERVICE); if (imm != null && activity != null) { View currentFocus = activity.getCurrentFocus(); if (currentFocus != null) { imm.hideSoftInputFromWindow(currentFocus.getWindowToken(), 0); } } } The SearchView maintains its focus

Remove extra icon at actionbar (when using ShareActionProvider and ActionBarSherlock)

我是研究僧i 提交于 2019-12-14 03:46:04
问题 I'm using ActionBarSherlock in my project, and want to set a share button to post content at FB etc etc... I achieved that this way: Adding items to action bar (using ActionBarSherlock) As you may know, ShareActionProvider adds a second icon with the most used option for sharing. That means another app's icon is appearing in my action bar, and I want to prevent that behavior... I've seen 2 possible solutions for that, and unfortunately both didn't worked to me :/ The first attempt was, in my

Tabs with ActionBarSherlock and Fragments with Top Nav bar

妖精的绣舞 提交于 2019-12-14 03:03:09
问题 I am implementing the same design as described here: Android ActionBarSherlock Top Bar and using the accepted answers code. Although it is pushing my nav bar below my tabs: Valid XHTML http://img255.imageshack.us/img255/8908/tabsa.png. Any idea why? 回答1: Its a bug with ActionBarSherlock (from https://github.com/JakeWharton/ActionBarSherlock/issues/327 ). Cause: When you call setDisplayShowHomeEnabled(false) in onCreate() and are using a tab navigation mode, the tabs will appear above the

ActionBar home button is misplaced in Nexus 5

末鹿安然 提交于 2019-12-13 20:11:57
问题 I'm using ActionBar Sherlock with custom home button. In Nexus 5 home button is misplaced to the right side of the actionbar. You can see it from the images. Has anyone came up to this problem? Thank you. Other devices (Such as Nexus 4, Samsung Galaxy S4 etc.) Nexus 5 For showing custom home button I'm am using actionBar.setDisplayShowCustomEnabled(true); 回答1: Hope, you have added below lines actionBar.setDisplayShowTitleEnabled(false); actionBar.setDisplayShowCustomEnabled(true); actionBar

Configuring the right Android-API level for my project

我怕爱的太早我们不能终老 提交于 2019-12-13 19:12:14
问题 In my application I want to target all Android Versions >= 8 (Push-Notification required), but I'm having a hard time understanding the right combination of APIs / dependencies I need for my project setup. The project will need Google APIs for location based services, and I need to / want to use ActionBarSherlock for ActionBar support. Is this setup correct? AndroidManifest.xml: (1) <uses-sdk android:minSdkVersion="8" android:targetSdkVersion="16" /> <application android:theme="@style/Theme