android-studio

Android Studio 3.3 folder icons

◇◆丶佛笑我妖孽 提交于 2021-02-06 08:46:09
问题 On the new Android Studio 3.3 some icons have change and I'm looking to understand what each one of the mean. This and this answers are outdated. For example in this picture I have two modules inside my project, but one have a green dot and the other this bar chart. What it means? 回答1: There's two components to the tree: The background color/folder color, and additional icons. Beyond this, there's also the text color, but it's mainly used for VCS and is beyond the scope of the question. See

How do I run adb on a mac terminal?

[亡魂溺海] 提交于 2021-02-05 20:24:32
问题 adb shell run-as /data/data/com.mypackagename returns adb command not found though I see adb in the directory ( /Users/me/Library/Android/sdk/platform-tools ) 回答1: You just need to add this path to your bash profile and source it: echo 'export PATH=$PATH:~/Library/Android/sdk/platform-tools/' >> ~/.bash_profile source ~/.bash_profile adb devices 回答2: If you are in that directory, you can run it with a leading dot-slash, i.e. ./adb shell run-as /data/data/com.mypackagename . In general, you

How do I run adb on a mac terminal?

落爺英雄遲暮 提交于 2021-02-05 20:16:54
问题 adb shell run-as /data/data/com.mypackagename returns adb command not found though I see adb in the directory ( /Users/me/Library/Android/sdk/platform-tools ) 回答1: You just need to add this path to your bash profile and source it: echo 'export PATH=$PATH:~/Library/Android/sdk/platform-tools/' >> ~/.bash_profile source ~/.bash_profile adb devices 回答2: If you are in that directory, you can run it with a leading dot-slash, i.e. ./adb shell run-as /data/data/com.mypackagename . In general, you

save keystore password in android studio 3

自闭症网瘾萝莉.ら 提交于 2021-02-05 12:58:54
问题 in android studio 2 you can save key store password and key password but in android studio 3 you can just save key password and you have to write key store password every time you want to build apk is there a settings or way to save key store password in android studio 3? I Know I can save the password in my build.gradle file but I don't want to password be saved on git. 回答1: I am having the same issue. But you can add your signing configs this way so they won't be checked into version

Android activity memory consumption

陌路散爱 提交于 2021-02-05 12:20:00
问题 I have one Android application that has 4 activities. First is splash screen basically, second is login, third is main and forth is one extra for drawing. Running that application on real device - Samsung Galazy tab from 2014 or smth with Android 4.4 runs to error and crashes after login activity. It says out of memory error. Main activity contains of multiple edit text fields and buttons, with also radio choice and making fields visible and invisible. When I set drawing activity after login,

How to Navigate any destination for action of header of drawer in navigation architecture

蹲街弑〆低调 提交于 2021-02-05 11:31:54
问题 Anyone please explain, How to define the action in Navigation architecture for header layout of drawer. Now, I need to set click of header of drawer and I set it to like this: headerOfNavDrawer.setOnClickListener{ //Here I want to navigate to editProfileFragment //But For navigation I need an action in nav arch graph. //Where to put action?? } 回答1: You have two things you need: A reference to the NavController . As per the Navigate to a destination documentation, you can use findNavController

How to Navigate any destination for action of header of drawer in navigation architecture

梦想的初衷 提交于 2021-02-05 11:31:11
问题 Anyone please explain, How to define the action in Navigation architecture for header layout of drawer. Now, I need to set click of header of drawer and I set it to like this: headerOfNavDrawer.setOnClickListener{ //Here I want to navigate to editProfileFragment //But For navigation I need an action in nav arch graph. //Where to put action?? } 回答1: You have two things you need: A reference to the NavController . As per the Navigate to a destination documentation, you can use findNavController

NullPointerException with findViewById in variable definition

社会主义新天地 提交于 2021-02-05 11:30:06
问题 I have read the immensely popular thread about Null Point Exceptions but I'm still confused about why I'm getting the error. I am attempting to make sure some EditText's are filled out. I have tried it in the onCreate method and it still doesnt work. Any help would be appreciated. I apologize if this is some stupid question. public class MainActivity extends AppCompatActivity implements View.OnClickListener { EditText scoutName = (EditText) findViewById(R.id.editSN); EditText teamNumber =

Floating label needs to show inside the textinput layout in android studio

孤街醉人 提交于 2021-02-05 11:28:26
问题 I have set a text input floating button But it shows the floating label outside the input box. How can I show inside the input box in android? <com.google.android.material.textfield.TextInputLayout android:id="@+id/text_input_layout" android:layout_width="fill_parent" android:layout_height="fill_parent" android:textColorHint="@color/white_new" app:hintTextAppearance="@style/TextAppearance.App.TextInputLayout" android:hint="@string/label"> <EditText android:id="@+id/et_name" android:layout

How to import Guava into Android applications

北战南征 提交于 2021-02-05 10:47:05
问题 What is the proper way to import Guava into an Android project? Every time I try to use it I get a NoClassDefFoundError . This is what I'm doing to generate the crash. I'm using Android Studio 3.0 Canary 7. Create an new project File > New > New Project , target API 26.0 , using the Empty Activity template. Add to app/build.gradle in the dependencies section implementation "com.google.guava:guava:20.0" Add this to the onCreate method in MainActivity.java ImmutableList<String> foo =