android-appcompat

Error : Ambiguous method call. Both findViewById (int) in AppCompactActivity and Activity

孤街醉人 提交于 2020-02-18 05:40:14
问题 I am getting the error: "Ambiguous method call" on initializing Toolbar using Android Studio 3.0 RC1. I have extended my Activity with AppCompatActivity and compiling my application using 'compileSdkVersion 26'. Attaching a screenshot of the error. 回答1: If you recently updated your project to API, Try doing File -> Invalidate Caches / Restart then File -> Sync Project with Gradle Files this resolve for me. 回答2: Upgrade to appcompat 27 solved this for me 回答3: You have import android.support.v7

Error : Ambiguous method call. Both findViewById (int) in AppCompactActivity and Activity

回眸只為那壹抹淺笑 提交于 2020-02-18 05:40:13
问题 I am getting the error: "Ambiguous method call" on initializing Toolbar using Android Studio 3.0 RC1. I have extended my Activity with AppCompatActivity and compiling my application using 'compileSdkVersion 26'. Attaching a screenshot of the error. 回答1: If you recently updated your project to API, Try doing File -> Invalidate Caches / Restart then File -> Sync Project with Gradle Files this resolve for me. 回答2: Upgrade to appcompat 27 solved this for me 回答3: You have import android.support.v7

AppCompat Toolbar: Change Overflow Icon Color in ActionMode

自古美人都是妖i 提交于 2020-01-30 14:31:33
问题 With the AppCompat Toolbar, I want to be able to change the color of the overflow menu icon on ActionMode change. For example, the overflow icon will be white in normal Toolbar mode. And will turn black on ActionMode. So far, I have managed to change the background of the action mode as well as the title text. But I have yet to find a way to change the overflow menu icon color. I know that there's an answer available: Change ActionMode Overflow icon I tried the first solution and I wasn't

“package android.support.v7.app does not exist” error in androidStudio

元气小坏坏 提交于 2020-01-30 08:50:29
问题 i am just starting with android development using androidStudio i am following udacity tutorial where they asked us to copy paste some code and run it i am unable to run the cod after pasting i think the major problem is while importing import android.support.v7.app.AppCompatActivity; i have checked internet for solution to this problem including stackoverflow but it seems that it is different for each case i have tried to import import androidx.appcompat.app.AppcompatActivity; instead of

“package android.support.v7.app does not exist” error in androidStudio

别来无恙 提交于 2020-01-30 08:50:21
问题 i am just starting with android development using androidStudio i am following udacity tutorial where they asked us to copy paste some code and run it i am unable to run the cod after pasting i think the major problem is while importing import android.support.v7.app.AppCompatActivity; i have checked internet for solution to this problem including stackoverflow but it seems that it is different for each case i have tried to import import androidx.appcompat.app.AppcompatActivity; instead of

“package android.support.v7.app does not exist” error in androidStudio

核能气质少年 提交于 2020-01-30 08:49:44
问题 i am just starting with android development using androidStudio i am following udacity tutorial where they asked us to copy paste some code and run it i am unable to run the cod after pasting i think the major problem is while importing import android.support.v7.app.AppCompatActivity; i have checked internet for solution to this problem including stackoverflow but it seems that it is different for each case i have tried to import import androidx.appcompat.app.AppcompatActivity; instead of

How to make the distance between left edge of Toolbar and Search Icon same as that between the right edge of the toolbar and the Cancel Icon?

我们两清 提交于 2020-01-28 02:45:48
问题 I am trying to add a SearchView to Material Design Toolbar / ActionBar such that the SearchView is expanded by default and takes up the entire space of the Toolbar width-wise. I have the following Toolbar so far. The problem with it is: I want the Search icon to have the same distance from the left edge of the screen as that of the X icon from the right edge of the screen. How can I do that? The X icon appears only when I start typing a search query, and then it disappears if I cancel the

How to make the distance between left edge of Toolbar and Search Icon same as that between the right edge of the toolbar and the Cancel Icon?

十年热恋 提交于 2020-01-28 02:45:06
问题 I am trying to add a SearchView to Material Design Toolbar / ActionBar such that the SearchView is expanded by default and takes up the entire space of the Toolbar width-wise. I have the following Toolbar so far. The problem with it is: I want the Search icon to have the same distance from the left edge of the screen as that of the X icon from the right edge of the screen. How can I do that? The X icon appears only when I start typing a search query, and then it disappears if I cancel the

Bluetooth LE can't find any device on android 6.0

ぐ巨炮叔叔 提交于 2020-01-25 09:27:09
问题 I am building an app that receives data from bluetooth device and is fully functional on a 4.4.4 android smartphone. But when I try it on version 6.0 devices it does not find the bluetooth devices. I have activated location on the phone and I have added the permissions for location on manifest file but nothing happens. I have read somewhere that I have to request permission from the user and I have tried to add ActivityCompat.requestPermissions(this,new String[]{Manifest.permission.ACCESS

Can't use android.support.v7.widget.Toolbar with android.useAndroidX=true

半世苍凉 提交于 2020-01-24 20:47:07
问题 in app/build.gradle: implementation 'com.android.support:appcompat-v7:28.0.0' in my activity I use import android.support.v7.widget.Toolbar Nice. It's work finde. But when I migrate to androidx I add this: android.useAndroidX=true android.enableJetifier=true As result now my activity not compile with error: import android.support.v7.widget.Toolbar; Cannot resolve symbol 'v7' Is it possible to use android.support.v7.widget.Toolbar together with anrdoidx.* package? 回答1: Since you are migrating