android

Change toolbar menu item text color dynamically on different Android version

折月煮酒 提交于 2021-02-16 20:57:14
问题 Need to change toolbar menu item text color in different fragments. Right now i have two fragments when this must work. I set static style AppTheme with. <item name="actionMenuTextColor">@color/black</item> In first fragment text must be black and in second white. I used this option when set SpannableString instead of String in setTitle on menuItem. This work good with version 8.0 and greater. When check how it works on 5.0, 6.0, 7.0 nothing change. Style set in Application section in

Android Studio OpenCV NDK: Unspecified error, The function is not implemented

 ̄綄美尐妖づ 提交于 2021-02-16 20:46:09
问题 I write in Android Studio on Windows. And I use OpenCV in my native c++ code.When calling the function, I get this error in logcat: "OpenCV Error: Unspecified error (The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or Carbon support. If you are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config, then re-run cmake or configure script) in cvShowImage, file /Volumes/Linux/builds/master_pack-android/opencv/modules/highgui/src/window.cpp, line 545". I found

How to make “sourceDirectories” public in Jacoco report generation?

久未见 提交于 2021-02-16 20:32:10
问题 I was following this post to setup Jacoco code coverage for my project. But I am facing a error while writing the task to generate the report. Gradle Task task jacocoTestReport(type: JacocoReport, dependsOn: ['testDebugUnitTest', 'createDebugCoverageReport']) { reports { xml.enabled = true html.enabled = true } def fileFilter = ['**/R.class', '**/R$*.class', '**/BuildConfig.*', '**/Manifest*.*', '**/*Test*.*', 'android/**/*.*'] def debugTree = fileTree(dir: "$project.buildDir/intermediates

Java ClassNotFoundException (java.sql.SQLType) in MySql Connection

会有一股神秘感。 提交于 2021-02-16 20:29:08
问题 I am developing an android app, which connects to a mysql server that was working, but now a java.lang.ClassNotFoundException error: Didn't find class "java.sql.SQLType". I don't know what happened, the only things I changed was the version of the mysql connector, and the computer I was working on, please help me. Edit Sorry for the lack of information about the project, but I never know what is needed to help discover the problem. I am using gradle, with java 1.8 and Android SDK 9.0 (Pie)

Retrofit 2: No virtual method newJsonReader(Ljava/io/Reader;) NoSuchMethodException

坚强是说给别人听的谎言 提交于 2021-02-16 20:23:41
问题 I am searching for this error whole internet, but yet, only one stackoverflow entry with no answer or comment. I am trying to use Retrofit 2. It is my first time using it. Here are my dependencies: compile 'com.squareup.retrofit2:retrofit:2.1.0' compile 'com.squareup.retrofit2:converter-gson:2.1.0' compile 'com.google.code.gson:gson:2.6.2' I exclued any OkHttp libraries as Retrofit already uses it. This is my request interface: public interface LoginService { @POST(HTTPService.AUTHENTICATIO

Scrollable TabWidget or TabLayout

心不动则不痛 提交于 2021-02-16 20:17:19
问题 Here is a library I got. I had added implementation 'ru.noties:scrollable:1.3.0' to my build.gradle . But, when I implement TabLayout of ru.noties:scrollable <ru.noties.scrollable.sample.TabsLayout android:id="@+id/tabs" android:layout_width="match_parent" android:layout_height="@dimen/tabs_height" android:background="@color/md_teal_500"/> I am getting the class isn't found. I am actually trying to use TabWidget like PlayStore . I want TabWidget like that gif. How to do that? Or, is there any

Scrollable TabWidget or TabLayout

限于喜欢 提交于 2021-02-16 20:17:09
问题 Here is a library I got. I had added implementation 'ru.noties:scrollable:1.3.0' to my build.gradle . But, when I implement TabLayout of ru.noties:scrollable <ru.noties.scrollable.sample.TabsLayout android:id="@+id/tabs" android:layout_width="match_parent" android:layout_height="@dimen/tabs_height" android:background="@color/md_teal_500"/> I am getting the class isn't found. I am actually trying to use TabWidget like PlayStore . I want TabWidget like that gif. How to do that? Or, is there any

Flutter :- Inside the PageView Image is not setting to fit the screen on width?

痴心易碎 提交于 2021-02-16 20:16:08
问题 I am using the PageView for the view-pager functionality and showing the image on each page with contains some text and button on each page. As I am using the Stack widget for putting the view on one another like Relative-layout in Android , But My Image on the First Page of the PageView is not set to fit on the screen I have tried the below solution like below 1).First link 2). Second Link But not getting the proper solution, I have tried the below lines of code for it, class

Cannot resolve second_activity Android Studio [duplicate]

倖福魔咒の 提交于 2021-02-16 20:08:27
问题 This question already has answers here : AndroidStudio Cannot Find Layout (2 answers) Closed 10 months ago . I am new to Android Studio and I was working on moving from one activity to other. Name of other activity is activity_second . The following is the code of the SecondActivity Java class. public class SecondActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_second); if

Firebase Cloud Messaging : Expiration of FCM token

强颜欢笑 提交于 2021-02-16 20:07:16
问题 I understand that the FCM token renews itself if one of the following happens. -The app deletes Instance ID -The app is restored on a new device -The user uninstalls/reinstall the app -The user clears app data. The following can be used at the App side to monitor Token renewal. Monitor token generation The onTokenRefreshcallback fires whenever a new token is generated, so calling getToken in its context ensures that you are accessing a current, available registration token. Make sure you have