android-support-library

What does ActionBar#setDefaultDisplayHomeAsUpEnabled in Android Support library?

烂漫一生 提交于 2019-12-20 03:08:43
问题 I know what setDisplayHomeAsUpEnabled does, but what is setDefaultDisplayHomeAsUpEnabled for I can only wonder. No documentation found, cannot find anything except it is being used. 回答1: This method is only available in the Support Action Bar, not in the "native" ActionBar class available since Android 3. More importantly, it is annotated with @hide in the source, meaning it is not part of the official API for third-party developers. That is why it is nowhere documented by Google. You should

ActionBarCompat menu item is not showing [duplicate]

折月煮酒 提交于 2019-12-20 01:14:26
问题 This question already has answers here : Actionbar not shown with AppCompat (3 answers) Closed 5 years ago . Here is my general.xml file <menu xmlns:android="http://schemas.android.com/apk/res/android" > <item android:id="@+id/action_settings" android:orderInCategory="100" android:showAsAction="never" android:title="@string/action_settings"/> <item android:id="@+id/next" android:title="Next" android:visible="true" android:enabled="true" android:showAsAction="always" android:orderInCategory="1

Extract Support Library layout attributes into styles

不羁岁月 提交于 2019-12-20 00:20:14
问题 I am extracting styles for views which are inside Support Library's GridLayout . Therefore, I have both attributes from the "android" namespace, e.g. android:layout_marginLeft="8dp" and attributes from the "app" (http://schemas.android.com/apk/res-auto) one, e.g. app:layout_columnSpan="2" . First, Android Studio doesn't recognize the attributes from "app" when I try to extract the attributes as a style. Second, it doesn't seem that extracting them into styles.xml manually brings any effect to

How do you ensure resources (e.g. styles) of a support library project (e.g. android-support-v7-appcompat), are added to your project?

久未见 提交于 2019-12-19 11:36:15
问题 I am trying to implement the actionbarcompat support library project in my android application and I have followed the guidelines here from the android website on how to implement these but the resources of the support library still are not available to my project. Note: I am able to use methods defined from the compiled classes of the library project, I just don't know how to reference from the styles. I am using eclipse IDE. Anybody with an idea how or what I am doing wrong please assist me

getActionBar().setDisplayHomeAsUpEnabled(true); nullpointer in preferenceActivity

假装没事ソ 提交于 2019-12-19 09:58:29
问题 I searched a lot for this issue, but didn't found nothing relevant . I' updated my app project to use api 21, now when i run preferenceactivity i get a nullpointer on that row. This is my code (it's the same code provided from eclipse when creating a new settingsactivity). package com.example.prova; import android.annotation.TargetApi; import android.content.Context; import android.content.res.Configuration; import android.media.Ringtone; import android.media.RingtoneManager; import android

NotificationCompat.Builder(getApplicationContext(), CHANNEL_ID) not working on Oreo Firebase notification

痴心易碎 提交于 2019-12-19 07:25:08
问题 I am trying to show notification using Firebase in Oreo version so it's not showing when I get Solution NotificationCompat.Builder(this, CHANNEL_ID) but it's showing me like this and my build.gradle file is apply plugin: 'com.android.application' dependencies { compile project(':library') compile project(':camerafragment') compile 'com.google.android.gms:play-services:11.0.0' compile 'com.squareup.picasso:picasso:2.5.2' compile 'com.mcxiaoke.volley:library:1.0.17' compile 'com.android.support

Refresh fragment not working any more

匆匆过客 提交于 2019-12-19 06:58:10
问题 I lost some hours today because my functionaly code were not working any more. The code to reload the view of a fragment was not working anymore after updating to the new version of Support Library 25.1.0: This is my code : FragmentManager manager = getActivity().getSupportFragmentManager(); FragmentTransaction fragmentTransaction = manager.beginTransaction(); fragmentTransaction.detach(fragment); fragmentTransaction.attach(fragment); fragmentTransaction.commit(); I have tried to debug

Didn't find class “androidx.core.content.FileProvider”

廉价感情. 提交于 2019-12-19 06:39:11
问题 I migrated my app to AndroidX and it's crashing on launch on API level 21. My application throws this exception: 10-08 09:42:50.930 11346-11346/com.example.test E/AndroidRuntime: FATAL EXCEPTION: main Process: com.example.test, PID: 11346 java.lang.RuntimeException: Unable to get provider androidx.core.content.FileProvider: java.lang.ClassNotFoundException: Didn't find class "androidx.core.content.FileProvider" on path: DexPathList[[zip file "/data/app/com.example.test-1.apk"]

How to cancel a JobIntentService

只愿长相守 提交于 2019-12-19 05:54:06
问题 How can I cancel a JobIntentService? I see no methods to do so in the docs, apart maybe from the JobSheduler API and the Context#stopService(...) method, which I'm unsure if it's the right way. 回答1: JobIntentService is only bringing IntentService to Android 8+ that is more strict about background services. It runs like old IntentService s on devices with older versions of Android. IntentService has never been designed to be cancelled , hence the lack of any API to cancel a JobIntentService .

Fragment with ViewPager inside Fragment and FragmentStatePagerAdapter results in Exception (with complete example)

两盒软妹~` 提交于 2019-12-19 05:38:25
问题 I have a simple Fragment with a ViewPager. I'm using the up to date support library, v4 rev18! If I show the sub fragment the first time, everything works fine, if I go back and show it again, the app crashes with the following exception: I have a complete example which shows, WHEN the following exception is occuring: java.lang.NullPointerException at android.support.v4.app.FragmentManagerImpl.getFragment(FragmentManager.java:569) at android.support.v4.app.FragmentStatePagerAdapter