Questions tagged as 'android-studio'

1
answer

Save user ID in all the fragments of an app?

I have a fragment login, a fragment to register clients and depending on who enters the login we will collect a different ID for each user entered. In an answer to this question I was recommended to create a class with a couple of get and set...
asked by 21.12.2018 / 02:40
1
answer

access a view that is in a fragment from activity?

I want to access from the main activity a Button that is in a fragment by means of this code: Button button = blankFragment.getView().findViewById(R.id.btnFragment); but I get the following error: Caused by: java.lang.NullPointerException...
asked by 28.12.2018 / 04:23
1
answer

How to prevent alertdialog.builder from closing if an option is not selected?

I want to avoid that the AlertDialog.Builder is closed if an option is not selected, and probe removing the dialog.dismiss() but the same when I click on the button accept without having selected an option closes, I want the AlertDialog t...
asked by 01.01.2019 / 18:07
2
answers

android studio: when I want to edit a layout, garbage appears

I am new to Android Studio and some behaviors make me crazy like the following: Until a few days ago in my project everything was fine when I found that when I entered any of the xml directories in the layout I found: /* AUTO-GENERATED FILE...
asked by 30.12.2018 / 04:16
2
answers

Closure of application [closed]

When I add this part of the code the application is closed, the code works because I have it in another application which can be the error WebView view = (WebView) this .findViewById (R.id.webView); view.getSettings (). setJavaScri...
asked by 05.09.2016 / 05:24
3
answers

Problem with "Gradle sync failed: Could not find any matches for com.android.tools.build:gradle:2.2.+"

Today in the morning I went to start my project in react-native and I have not managed to compile it for android. I get this fault. "Gradle sync failed: Could not find any matches for com.android.tools.build:gradle:2.2.+ as not versions of...
asked by 10.12.2018 / 17:06
1
answer

Close activities Android studio

I have an app with a side menu. The doubt I have that every time I use one of the menu options opens a new window. } else if (id == R.id.cine) { Intent intent = new Intent(this.getApplication(), Cine.class); startActivityForR...
asked by 27.12.2018 / 15:58
2
answers

JSON RECORD IT

I have this JSON { "id":2, "group_id":1, "default_billing":"2", "default_shipping":"2", "created_at":"2018-10-03 16:12:55", "updated_at":"2018-10-03 16:13:00", "created_in":"Default Store View", "email":"henryar...
asked by 06.12.2018 / 18:18
3
answers

change of value of textView depending on the selection of a spinner

The problem is the following, in the activity I have a textView and a spinner what I'm looking for is that when you select an option in spinner the value of textView change. This is the code public class longitud...
asked by 16.04.2017 / 16:09
1
answer

Why is my location deleted every 10 seconds, in androidstudio?

I am using android studio 3.0 and the emulator with android 8.0 and 6.0 to get the location using the gps of the device. Problem: I get the location from the emulator, the corresponding onLocationChanged method is activated, but every 10 seco...
asked by 27.11.2018 / 06:56