Posts by Thiago Luiz Domacoski • 7,310 points
323 posts
-
6
votes1
answer419
viewsA: Data persistence levels in android applications
Come on: onSavedIntanceState : It stores additional screen information, as variables that are not associated with View, so when recreating Activity, the data is populated! It saves (temporarily)…
-
4
votes1
answer7399
viewsA: How to resolve java.lang.Runtimeexception error: android.os.Transactiontoolargeexception
ERROR This can occur when you pass large amount of data through parameters of a Intent! When you receive this exception in your application, analyze if you are exchanging a lot of data between your…
-
1
votes2
answers5999
viewsA: How to put line break in the textview straight from xml?
You can add HTML tags to your text strings.html follows an example: html strings. <string name="minha_receita_1"> <![CDATA[ <ul> <li>1 caneca ou bule</li> <li>1…
-
2
votes4
answers163
viewsA: Deserialize Json and place values in views
Try it this way: import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.widget.ImageView; import android.widget.TextView; import com.squareup.picasso.Picasso;…
-
13
votes1
answer38768
viewsA: Click the button and open another Activity
For this you can use the startActivity method ( Documentation ) This method requests as a parameter a Intent This should be informed a Context (in your Activity case) and class of the Activity you…
-
3
votes1
answer37
viewsA: I have a fragment that renders an xml but if there is no record I want it to render another page(xml)
Try it this way: public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // Verificar se ha dados ou nao boolean isEmpty = false; View view = null; if(…
-
0
votes1
answer88
viewsA: Add script to post
cannot add external scripts in Wordpress.com. To add codes, it is recommended to use the shortcode [code]. Example: [code language="css"] your code here [/code] You can read more about this…
wordpressanswered Thiago Luiz Domacoski 7,310 -
0
votes1
answer88
viewsQ: Add script to post
I’m creating a free website on https://wordpress.com/ My intention is to add codes, and for this, I would like to use the Highlight.js My attempt was to add via CDN: <link rel="stylesheet"…
wordpressasked Thiago Luiz Domacoski 7,310 -
0
votes1
answer701
viewsA: Dex2oat failed - errors received in android install/update app. Dex permission denied
Starting with Android 6.0 (API level 23), users grant permissions to applications while they are running, not when they are installed. This approach optimizes the application installation process as…
androidanswered Thiago Luiz Domacoski 7,310 -
2
votes1
answer163
viewsA: Ping via android
Let us take this line of the result into consideration: 4 packets transmitted, 4 Received, 0% Packet Loss, time 3004ms What interests you is the following part: 4 received. To get this number, we’ll…
-
4
votes1
answer164
viewsA: Notification remains in status bar even after click
try as follows: builder.setAutoCancel (true); Also, although it is not really necessary, if you really want to use FLAG_AUTO_CANCEL, just add it: Notification notification= builder.build();…
-
3
votes1
answer206
viewsA: Pick address when adding marker on map
To this end, use the Geocoder. Here is an example of how to obtain an object Address through a Location: /** * AsyncTask que através do Location pega o endereço */ class LoadAddress extends…
-
1
votes2
answers457
viewsA: How to create dynamically several times the same layout?
Follow a simple example of what I understood : We have a button to add and a LinearLayout that will receive the EditText for the user to add a new address: activity_main.xml <LinearLayout…
-
3
votes1
answer176
viewsA: Why does Retrofit make an exception when the status code is 204?
In class okhttp3.internal.http.HttpEngine, in the method Response proceed(Request request) there is the following: Response var6 = HttpEngine.this.readNetworkResponse(); int var9 = var6.code();…
-
1
votes1
answer1251
viewsA: Can’t Convert Object of type java.lang.String to type
The error displayed: com.google.firebase.database.Databaseexception: Can’t Convert Object of type java.lang.String to type com.robertoc.meublogclash.User at It means he can’t convert into…
-
1
votes2
answers124
viewsQ: Know if user has Waze installed
I have an application that performs routes between the current position and a certain point. For this, I call an Activity: final Intent intent = new Intent(android.content.Intent.ACTION_VIEW,…
-
3
votes1
answer917
viewsA: Grab an Image from the gallery and move to a folder
Here is an example of the implementation of the functionality that selects an image from the gallery and 'moves' to another directory: import android.content.Intent; import…
-
1
votes1
answer248
viewsA: Update a textview for a few seconds
I believe this is what I wanted to do: import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.widget.TextView; public class MainActivity extends AppCompatActivity…
-
1
votes1
answer1279
viewsA: Various data on an Arrayadapter
For this it is necessary to create a ArrayAdapter customized, and an object to encapsulate the information that will show in the list: Example of the object we will work on ArrayAdapter: class…
-
2
votes1
answer469
viewsA: Android use findViewById from other Activity
As stated by @Giulianabezerra in the comment, uses if a Intent to provide links between Activity’s at runtime. Follow an example: public class MainActivity extends AppCompatActivity { public final…
-
0
votes3
answers2965
viewsA: How to delete data from database in android studio?
Follow an example: private void SairWV(){ dao = new BancoDeDados(context); SQLiteDatabase db = dao.getWritableDatabase(); /** irá remover todos os registros **/ db.execSQL(String.format("DELETE FROM…
-
1
votes0
answers35
viewsQ: Setar Bearing using Cameraupdate
I have two positions (LatLong) I’d like to center them on the map! For that, I’ll tell you what: final LatLngBounds.Builder builderZoom = new LatLngBounds.Builder(); if(null != mCurrentLocation){…
-
1
votes0
answers49
viewsQ: Transparent surfaceview on top of Toolbar
I’m drawing a graph, and for that I’m using a Class that extends from SurfaceView. The screen where it will be drawn has a background image. So that the SurfaceView be transparent, I did the…
androidasked Thiago Luiz Domacoski 7,310 -
0
votes2
answers86
viewsA: Compare Background with Drawable
Try to Transform the drawable in Bitmap and compare using the method sameAs. Follow an example: final ImageButton buttonImage = ImageButton.class.cast(findViewById(R.id.facebookLogin)); if(null !=…
-
0
votes2
answers117
viewsA: How to identify the click on a drawableLeft
I was able to detect the click on DawableLeft using the getX(), instead of getRawX() Follows the implementation: passwordText.setOnTouchListener(new View.OnTouchListener() { @Override public boolean…
-
1
votes2
answers117
viewsQ: How to identify the click on a drawableLeft
I got the following EditText: <EditText android:id="@+id/mPasswordTxt" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_gravity="center_horizontal"…
-
5
votes2
answers527
viewsA: Is there a difference between the visibility of a view.GONE or false?
In accordance with the documentation , the method setVisibility calls for a int, and not a boolean! You can use three options: View.VISIBLE (Being shown) View.INVISIBLE (Not displayed but occupies…
-
2
votes1
answer169
viewsA: Popular Listview with Retrofit2 Data
Try it this way: public void onResponse(Call<UdacityCatelog> call, Response<UdacityCatelog> response) { //verifico se esta tendo resposta if(!response.isSuccessful()){ Log.i("Code",…
-
1
votes0
answers24
viewsQ: Receive information shared by Google Maps
I have an application where you can share links! I do this by taking information from meta og with Jsoup: final Document doc = Jsoup.connect(url).get(); final Elements itens =…
-
2
votes1
answer112
viewsQ: Collect all the Extras from an Intent
Is there any way to find out what all the Extras of an Intent are! CONTEXT: I have an app that gets url’s shared by other apps: if (Intent.ACTION_SEND.equals(action)) { final String url_ =…
-
1
votes2
answers68
viewsA: Como Release App
In the archive build.gradle (Module:app) add the following code: android { signingConfigs { config { keyAlias KEY_ALIAS keyPassword KEY_PASSWORD storeFile file(STORE_FILE) storePassword…
-
1
votes1
answer597
viewsQ: Collect data from Facebook SDK User
I have the following code to log into Facebook: final FacebookCallback facebookCallback = new FacebookCallback<LoginResult>() { @Override public void onSuccess(LoginResult loginResult) {…
-
2
votes1
answer40
viewsA: Error searching blogger information via json
The error occurs when browsing the properties of JSON In this case, to have the title of the post’s you need to navigate in the following Objects: feed > entry > title In the title object we…
-
1
votes1
answer84
viewsA: Problems sending a notification
The error occurs because you are trying to open a connection on Thread main of the application ( Networkonmainthreadexception ). In this case it is necessary to perform this operation in a Asynctask…
-
1
votes2
answers694
viewsA: How to pick a phrase value in String
There are several ways to perform this operation! Follow an example using substring and index In this case, we will find the Character position ':' through the method index . Knowing your position,…
-
2
votes3
answers785
viewsA: Create Textview’s dynamically
Follow an example: XML: <ScrollView android:layout_width="match_parent" android:layout_height="match_parent" > <LinearLayout android:id="@+id/mContent" android:orientation="vertical"…
-
2
votes1
answer574
viewsA: Android - Error with setContentView(R.layout.Home);
This could be happening for two reasons: 1. Uppercase This property should only contain lowercase characters. When trying to run the application the following error will occur: Error: 'P' is not a…
-
4
votes3
answers62
viewsA: Error with "Method"
As reported by @Jorge B. , I believe there’s another mistake besides this! According to the documentation: For this to work, the method must be public and accept a View as its only parameter. So try…
androidanswered Thiago Luiz Domacoski 7,310 -
2
votes1
answer195
viewsA: Calling a method using Spinner selection
Through the setOnItemSelectedListener: spinner.setOnItemSelectedListener(new OnItemSelectedListener() { @Override public void onItemSelected(AdapterView<?> parentView, View selectedItemView,…
-
2
votes2
answers53
viewsA: Error using values string
The class TextView has the method setText overloaded in various ways (Follows the documentation): You can pass the id (Resid) of a String, and also the String (Charsequence) in itself, among other…
-
2
votes2
answers758
viewsA: Ask the user if he really wants to quit
Try it this way: if (id == R.id.nav_send) { builder = new AlertDialog.Builder(atividade); builder.setTitle("Deseja realmente sair?"); builder.setPositiveButton("Sim", new…
-
5
votes2
answers93
viewsA: When I use this permission an error occurs in the WHOLE. What do I do?
The error occurs because it is returning a variable that does not exist ! In addition to checking if there is permission it is necessary to request, if there is no! Follow an example: public static…
-
1
votes4
answers2097
viewsA: Print arraylist information on the screen
We have a problem with this code! His list is from String and you’re trying to add Cachorro There are two options ( that will print the same content ) Turning the List into a Dog List:…
-
4
votes1
answer116
viewsA: Mainactivity does not find activity_main
Check your import’s which R he’s bringing! This one being shown, belongs to the Android! To gain access to your project’s layout, import the R concerning your project, import seu.pacote.R;…
androidanswered Thiago Luiz Domacoski 7,310 -
1
votes2
answers69
viewsA: How do you make it when the user touches the menu symbol and the message appears in Toast?
Try to change onMenuItemSelected for onOptionsItemSelected! Follow an example: @Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()){ case 0 :…
androidanswered Thiago Luiz Domacoski 7,310 -
2
votes2
answers46
viewsA: Problem to check list
Try it this way: if (item.name.equals(nameD)) { Log.d("D","2"); showNotificacion(view,"A disciplina "+item.name+" já existe!"); return; } Follow a reading regarding this error…
-
0
votes1
answer194
viewsA: How to pass more than one parameter in a Paint() method in Java?
One way around this issue is to make the Outro on a class property. And when instantiating the class passes it on the constructor! Follow an example: public class Desenho extends JFrame{ private…
-
0
votes1
answer111
viewsA: edittext comparison: Prevent duplicate date and time
Try the following: public String insereAgenda(String nome, String dia, String horario, String corte, String valor){ ContentValues valores; long resultado; Integer idComMesmoDataHora =…
androidanswered Thiago Luiz Domacoski 7,310 -
0
votes1
answer69
viewsA: receive the size of a folder in textview
Here’s an example of how to get information from a folder. This is just one example! Where we list the folder Download ! It’s up to you to find the folder you want: Follow the example: import…
-
1
votes1
answer333
viewsA: Comparison of an edttext with an Sqlite Bank value
This requires a consultation! This will return the ID (if there is) an object with the same DATA and HORA! If there is no record, this method will return -1 public Integer validarData(final String…