Posts by Guilherme Montanher • 461 points
36 posts
-
0
votes1
answer26
viewsA: Spring boot, using H2 bank for testing
You can create a file .properties with the acronym -dev, so you can indicate the profile at the time of running your project. Example: Maven mvn spring-boot:run -Dspring-boot.run.profiles=dev See…
-
0
votes1
answer35
viewsA: Play a series of audios on android
First you should put your audio files in the folder raw of your project, done this using the object MediaPlayer simply initialize the object for use. Example: Creating MediaPlayer mediaPlayer =…
-
0
votes2
answers66
viewsA: Error in list/BD
Try this way: lista.setOnLongClickListener(new OnLongClickListener() { @Override public boolean onLongClick(View v) { . . . } }); I hope it helps!…
-
0
votes1
answer27
viewsA: Android Studio java: listview in an Activity, send information to her from another Activity
//Sending values lista.setOnItemClickListener(new OnItemClickListener() { @Override public void onItemClick(AdapterView<?> arg0, View arg1, int position, long id) { String descricao =…
-
1
votes1
answer545
viewsA: Android app does not connect on local webservice
To access your local server by Android Studio emulator you must use this IP 10.0.2.2. I hope it helps!
-
0
votes1
answer101
viewsA: How to center a recyclerview (horizontal) item horizontally on the screen?
If you are using buttons to manage navigation you can use this command: recyclerView.scrollToPosition(position); which will center in the Recycler view the position passed in the constructor. I hope…
-
0
votes1
answer347
viewsA: Grab images from the drawable folder by name
You can use this code to capture the id from the drawable name Resources resources = context.getResources(); int resourceId = resources.getIdentifier("minha_imagem_1", "drawable",…
-
0
votes2
answers38
viewsA: Problems with internet scanning method on Android
I usually use these two methods to ensure that it is connected to a network and that this network has internet. public static boolean isOnline(Context context) { ConnectivityManager cm =…
androidanswered Guilherme Montanher 461 -
1
votes1
answer148
viewsA: Load Empty Spinner
You can add an empty field before popular with the array, this same index being 0 you can also use as validation if the user has not selected any option. Example: ArrayList<String> meuArray =…
-
1
votes1
answer199
viewsA: Why can’t I add a marker by clicking on the map?
The problem is that you are adding the click on an object null that was not instantiated you can only add the click after receiving the object in the method onMapReady. Try the solution below:…
-
0
votes1
answer185
viewsA: Volley Android, recover server response
Try to use the getMessage() in your Exception, it may contain the cause of the error. Example @Override public void onErrorResponse(VolleyError error) { Toast.makeText(contexto, error.getMessage(),…
-
0
votes1
answer36
viewsA: Remove title bar Android - Cordova
Try this on your Activity. if (getSupportActionBar() != null) getSupportActionBar().hide(); Thus the ActionBar will be hidden.
-
4
votes1
answer808
viewsA: Organize layout files in Android studio
You can do this with Gradle from a look at this sample project Here’s an example of the block in the file build.gradle of the example project, the subfolders are declared before. sourceSets { main {…
-
0
votes5
answers3128
viewsA: How to get Firebase data and insert it into a Textview?
I believe the flaw is here private Usuario usuario = new Usuario();, you instantiate the object with all its attributes null and then try to capture an attribute of it, however it will be null, so…
-
0
votes2
answers49
viewsA: Problem in my search engine code
Try to replace with this code: Example public void CarregarEncontrados() { int textlength = et.getText().length(); //Limpa o array com os estados encontrados //para poder efetuar nova busca…
-
1
votes1
answer403
viewsA: Disable chosen date in Datepickerdialog
Try to use this library Material Date Time Picker, on it you can set an option to show specific dates. Example datePicker.setSelectableDays(Calendar[] days) Passing a array of Calendar as a…
-
0
votes1
answer88
viewsA: Take data from a column in Mysql via POST and put into a Textview
The problem is updating a visual component outside the mainThread. Try this solution: private class RegisterUser extends AsyncTask<String, Void, String> { private TextView telefone; @Override…
-
2
votes2
answers490
viewsA: Difference between Activity and Content
When you create a Basic Activity it creates the xml of activity and of content together, this model already comes with a FABButton along with the layout so it creates 2 files the ideal is to use the…
-
1
votes2
answers48
viewsA: DAO SQLITE MVP Android
You can use the general context of the application getAplicationContext() See if it works like this.
androidanswered Guilherme Montanher 461 -
1
votes3
answers529
viewsA: Turn Jsonobject into Jsonarray
Try this way: JSONObject jsonObject = new JSONObject("my json"); JSONArray jsonArray = jsonObject.getJSONArray("1"); jsonArray.getString(0);// 1 Test with your json and see if the exit will be 1. I…
-
0
votes2
answers46
viewsA: Nullpointerexception on button inside include
No need to specify include within xml try this way. //botão proximo //View myLayout = view.findViewById( mlayoutslayout[position] ); btn_prox = view.findViewById(R.id.btn_prox);…
androidanswered Guilherme Montanher 461 -
0
votes1
answer67
viewsA: Add admob after a Listview in a Relativelayout
Try using a LinearLayout, see if this solution helps you. <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"…
-
2
votes1
answer260
viewsA: Debug app emulating on mobile
There is the possibility to view the device log by Logcat just select the device name in the Logcat tab. See the image. Try also to see in the developer options of your mobile phone if the usb…
-
1
votes2
answers66
viewsA: Email and password in the Android Studio app not registered in Firebase
Maybe your firebase rule file is restricting insertion. Take a look at this link and see if it helps you.…
-
0
votes1
answer18
viewsA: How to get button that is inside include
No need to inflate the layout btnprox to reference your Button, you can reference directly to your xml where the include this one inside. Try using your main layout, this will work.…
androidanswered Guilherme Montanher 461 -
1
votes1
answer178
viewsA: 6 build path Entries are Missing no eclipse
Usually this error happens when the eclipse loses the reference of libraries, try removing those libraries that are flagged with error and adding them again. I hope it helped.
-
0
votes2
answers174
viewsA: Call the Textwatcher method
How your method this static you will need to refer to Activity Example EditText myEditText = (EditText) findViewById(R.id.edit_text); MyActivity.insert(myEditText); I hope it helps you!…
-
1
votes1
answer39
viewsA: Recyrcleview Android
You can make an interface that will have a method that will be implemented in your Activity, pass this System to your Adapter set the onClickListerner to your button inside the Adapter and call the…
-
0
votes1
answer68
viewsA: Android - Save and Update String sent from one activity to another
Let me get this straight, you need to pass the status of CheckBox to another Activity! Try this: Intent i = new Intent(getBaseContext(), MainActivity.class); i.putBooleanExtra("checkBoxValue",…
-
1
votes1
answer38
viewsA: Httpurlconnection Android + Msyql
Try to turn this class into abstract and implement 2 abstract methods, so anywhere in your code this class is instantiated you can do a different programming. Example: abstract class AsyncEtapa…
-
2
votes1
answer120
viewsA: Recyclerview scroll position with Firebase
The problem is being in the method recyclerView.setAdapter(recyclerViewAdapterEscalas); the ideal would be to instantiate the Adapter and assign to the recyclerView only 1 time, to update the data…
-
0
votes2
answers268
viewsA: How to make a list from a GET request in Retrofit 2?
You can convert your JSON into a Jsonobject and go capturing its attributes. JSON { "nome": "José da Silva" "idade" : 30 } JAVA JSONObject jsonObj= new JSONObject("seu json aqui"); String nome =…
-
0
votes2
answers70
viewsA: Why can’t I use Onbackpressed Listener within Ragment
You can make a Systener to implement it in all Rfragments and Onbackpressed from your Activity to notify listeners. I hope I’ve helped!
androidanswered Guilherme Montanher 461 -
0
votes1
answer79
viewsA: How to get "currentLocation" inside a webview
From API 23 (Android 6.0) it is necessary to request the permissions at runtime. See if that helps you: https://developer.android.com/training/permissions/requesting.html?hl=pt-br…
-
0
votes3
answers2310
viewsA: Keyboard hides Edittext
Try it like this: <ScrollView android:layout_width="match_parent" android:layout_height="match_parent"> <EditText android:layout_width="match_parent" android:layout_height="wrap_content"…
androidanswered Guilherme Montanher 461 -
0
votes2
answers347
viewsA: Error while calling Activity
In the Androidmanifest.xml file try to add or change the property android:Theme from the Activity you want to open. Example: Androidmanifest.xml <activity android:name=".MainActivity"…