android-support-library

How to handle onContextItemSelected in a multi fragment activity?

点点圈 提交于 2019-12-27 16:40:16
问题 I'm currently trying to adapt my application to use the "Compatibility Libraries for Android v4" to provide the benefits of the usage of fragments even to Android 1.6 users. The implementation of a context menu seems to be tricky: The main activity of the application is extending the FragmentActivity class. The fragments are all based on one class which extends the Fragment class. The fragment class is calling registerForContextMenu() in its onCreateView() method and overrides the methods

Android: Issues with R after importing v7 appcompat

假装没事ソ 提交于 2019-12-25 09:25:35
问题 I imported the v7-appcompat support library following the instructions on the android developer site, and ran into the missing R issue that many other users have encountered. I've read through several similar questions users have posted here, and tried what was suggested but I'm still getting the missing R problem. I've re-imported the appcompat library, cleaned my project, restarted eclipse, changed my min and target SDK in both the manifest and properties, and still have the same issue. The

Android: Issues with R after importing v7 appcompat

前提是你 提交于 2019-12-25 09:21:03
问题 I imported the v7-appcompat support library following the instructions on the android developer site, and ran into the missing R issue that many other users have encountered. I've read through several similar questions users have posted here, and tried what was suggested but I'm still getting the missing R problem. I've re-imported the appcompat library, cleaned my project, restarted eclipse, changed my min and target SDK in both the manifest and properties, and still have the same issue. The

Casting a Menu Item in XML to a Spinner (Actionbar appcompat)

放肆的年华 提交于 2019-12-25 06:38:05
问题 I'm having some trouble casting a Menu Item in xml to a Spinner (actionbar compat) . I've tried a couple of options, like these Spinner as MenuItem not initialized by findViewById or Adding spinner to ActionBar (not Navigation , but spinner = (Spinner)item.getActionView(); keeps coming back as null. Setting up a new spinner works though, but that's probably not relevant to my problem. Code: @Override public boolean onCreateOptionsMenu(Menu menu) { MenuInflater inflater = getMenuInflater();

getFragmentManager( ) and support package

我只是一个虾纸丫 提交于 2019-12-25 04:56:21
问题 I'm learning to use fragments for build a dynamic application, but I've a problem with the Fragment Manager. When I pass it by the method getFragmentManager( ) is shown a warning because it returns the Fragment Manager of android.app, not from the support library. Do you know how to fix it? 回答1: You should use getSupportFragmentManager() instead of getFragmentManager() Also, make sure you are extending FragmentActivity and not just Activity . 来源: https://stackoverflow.com/questions/15460028

RenderScript No Class Def found, when trying to blur background image

跟風遠走 提交于 2019-12-25 03:13:25
问题 When trying to blur an image I want to use import android.support.v8.renderscript.* So I put this in my build.gradle file: android { compileSdkVersion 23 buildToolsVersion '23.0.1'" defaultConfig { minSdkVersion 14 targetSdkVersion 23 renderscriptTargetApi 18 renderscriptSupportModeEnabled true }} And I use this method to blur the image: public static Bitmap blur(Context ctx, Bitmap image) { int width = Math.round(image.getWidth() * BITMAP_SCALE); int height = Math.round(image.getHeight() *

Android viewpager inside dialogfragment, app crashed with no view found for id using API 17

▼魔方 西西 提交于 2019-12-25 02:54:13
问题 for the issue in question. Tried Searching for solutions and says getChildFragmentManager/getSupportFragmentManager should be used, but the problem is even with updated android sdk lib using the android support v13 (which has v4) installed, Eclipse Luna still cannot recognize getChildFragmentManager/getSupportFragmentManager. I also tried importing the support.app.v4 namespace but that will only make the ScreenSlidePagerAdapter's FragmentManager throw a type error. DialogFragment Class which

onNavigationItemSelected never called on Actionbar's spinner

好久不见. 提交于 2019-12-25 02:46:23
问题 I'm trying to build a drop down menu in the Action Bar Compat, as per the dev example: http://developer.android.com/guide/topics/ui/actionbar.html#Dropdown I can't get onNavigationItemSelected to fire though. The spinner dropdown item in the action bar is being generated, to the right of the actionbar's Title. When I press it I do see the triangle icon turn blue. The OnNavigationListener and Sting[]strings are being ran in OnCreate. How would I get this to work? public class Main extends

How to add swipe in tabs

拈花ヽ惹草 提交于 2019-12-24 23:40:00
问题 I am using support library to create action bar in my app. I have added actions in action bar thats working perfect. Now I edit tabs below that. But for changing tabs I have to click on tabs. I want to add swipe in this code. But Its difficult for me as I am taking reference from one link thats only show to add tabs and change them with on click on them. So please someone help me to add swipe from screen to change tabs. Code- public class Types extends ActionBarActivity { @Override public

ActionBarActivity with TabHost

╄→尐↘猪︶ㄣ 提交于 2019-12-24 19:16:42
问题 I am developing an app, with minimum sdk level 7 and that's why I use support library and ActionBarActivity to have a proper ActionBar, but also the layout of my page contains four tabs on the bottom of the activity, and as i already extend ActionBarActivity, I cannot extend TabActivity. The problem is when I write public class HomePageActivity extends ActionBarActivity { private TabHost mTabHost; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState