android-studio

What is Backwards Compatibility in Android Studio?

拥有回忆 提交于 2020-05-24 21:23:09
问题 I'm a newbie to Android Development. Even though I referred the android developer website, I didn't figure out. On the customize Activity dialog box, when I unchecked the Backwards Compatiblity(Appcompat) in Android Studio 2.3.1 It gave me a hint as: If false, this activity base class will be Activity instead of AppCompatActivity Generally, what do android developers prefer? enabling backwards compatibility or without it? Can anyone explain me which one is better. 回答1: Android apps can be

codeStyleSettings.xml always modified by Android Studio

女生的网名这么多〃 提交于 2020-05-24 20:16:05
问题 Using Android Studio 1.3.2, the .idea/codeStyleSettings.xml is constantly modified to add a section for <Objective-C-extensions>...</Objective-C-extensions\> . These changes are despite no Objective-C code existing within the project. After many attempts, I have been unable to revert these changes - they keep coming back every time Android Studio is opened. Where are these changes coming from and how can I avoid Android Studio constantly restoring the modifications? <Objective-C-extensions>

Flutter - Building for iOS, but the linked and embedded framework 'App.framework' was built for iOS Simulator

时光总嘲笑我的痴心妄想 提交于 2020-05-24 18:14:29
问题 After updating to Catalina 10.15.4 beta with Xcode 13.4 beta, which also updated Simulator to 13.4 (921.4). The application compiles and runs correctly on a physically attached device, but no simulators of any devices can pass this stage. I got the errors Building for iOS, but the linked and embedded framework 'App.framework' was built for iOS Simulator. or Building for iOS Simulator, but the linked and embedded framework 'App.framework' was built for iOS. How can I fix this? 回答1: Xcode 11.4

Remove all unused classes,methods from Android Studio project

杀马特。学长 韩版系。学妹 提交于 2020-05-24 14:32:10
问题 I have used the lint( Analyze->Inspect Code...) and find out unused methods and resources. All the unused resources removed by Refractor->Remove unused Resources but not found any option like this to remove java classes and methods. Is there any feature in the android studio or any Plugin which can remove all the java classes, the methods which are not used in code to save manual refracting? 回答1: This can be achieved by using the built-in inspection Java | Declaration redundancy | Unused

gradle Unexpected lock protocol found in lock file. Expected 3, found 0

浪尽此生 提交于 2020-05-24 06:49:31
问题 getting "Unexpected lock protocol found in lock file. Expected 3, found 0" error when trying to debug even after following this link and deleting the .gradle folder current gradle version is 4.4 and android studio 3.1.2 回答1: This error normally occurs when your system mistakenly shut down and the project is building. Here is the solution: close the project delete the project from Android Studio list Close Android Studio delete the .gradle folder from the root of your project Run Android

How to prevent one activity from resizing when keyboard opens

ε祈祈猫儿з 提交于 2020-05-24 05:21:50
问题 I want to prevent my activity from resizing when my keyboard opens. I know I can use android:windowSoftInputMode="adjustNothing" in my manifest folder to do that, but it applies the change to all of my activities. How can I apply this change to only one of my activities? I tried to add android:windowSoftInputMode="adjustNothing" to my activity but it didn't work. 回答1: Try this layout: <?xml version="1.0" encoding="utf-8"?> <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http

EditText Multiple Edit Fill check

放肆的年华 提交于 2020-05-24 05:21:10
问题 i am creating a project in which i have 3 Edit text filled i want to check if from 3 edit text any one should be filled any one from either 3 edit text i know how to check if all there is data in all edittext values private boolean validate_edit1() { string1= edit1.getText().toString().trim(); if (string1.isEmpty()) { edit1.requestFocusFromTouch(); edit1.setAnimation(shakeError()); edit1.setError(""); return false; } else { edit1.setFocusable(false); } return true; } private boolean validate

Is there a simple way to convert timestamp to date time in android while fetching data from Json?

戏子无情 提交于 2020-05-24 05:17:11
问题 JsonArrayRequest request = new JsonArrayRequest(Request.Method.GET,url, null, new Response.Listener<JSONArray>() { @Override public void onResponse(JSONArray response) { progressDialog.dismiss(); try{ for (int i = response.length()-1; i>=0 ; i--){ JSONObject jsonObject = response.getJSONObject(i); UpdateList value = new UpdateList(jsonObject.getString("update"),jsonObject.getString("timestamp")); mData.add(value); } notificationAdapter= new NotificationAdapter(getActivity(),mData);

Android Studio's git commit not seeing my modified files

我只是一个虾纸丫 提交于 2020-05-24 04:01:25
问题 I am more familiar with using git on the command line (MacOS, especially). However, I sometimes try to use the Android Studio VCS "commit", as it is sometimes slightly faster to use. The weird problem that I came across today is that Android's Studio git "commit" does not see my 4 modified files, whereas from the command line, git status shows clearly the 4 modified files. I have seen this Stack Overflow post and I have checked it is not for any of these reasons (like, not adding the file to

Flutter disable system debug messages in Run Tab

情到浓时终转凉″ 提交于 2020-05-23 04:54:08
问题 I use: print('Pls. show this line only'); to debug my flutter apps developed by Android Studio. However, the output in the [Run Tab] is usually something like: Tens/Hundreds of system debug messages I/flutter ( 9154): Pls. show this line only Tens/Hundreds of system debug messages OK, sometimes it takes me minutes to find my own debug message [Pls. show this line only]. My question is simple, how can we disable [Tens/Hundreds of system debug messages] in the Run Tab of Flutter Project in