Posts by Márcio Oliveira • 2,237 points
129 posts
-
-1
votes1
answer3740
viewsA: Camera permission on Android
The camera does not request user permissions. Change this permission on your Androidmanifest: <uses-feature android:name="android.hardware.camera" android:required="true" />…
-
1
votes1
answer806
viewsA: java.lang.Runtimeexception: An error occured while executing doInBackground()
You have not initialized your Jsonarray list correctly. Eliminate the line: JSONArray listaAutor = null; And replace the line that feeds that variable with: JSONArray listaAutor =…
androidanswered Márcio Oliveira 2,237 -
-1
votes2
answers379
viewsA: Error when using Google’s API to run from Android 2.3 (API Level 9)
Add this tag to your Androidmanifest: <uses-sdk android:targetSdkVersion="25" android:minSdkVersion="14" tools:overrideLibrary="com.google.android.gms.ads.impl"/> More information here. OBS:…
-
1
votes1
answer82
viewsA: Problem with threads on Android
You can create an interface in your Httprequest class with a callback method that will work with the list of obtained recipes. public interface OnRecipesReady { public void…
-
1
votes3
answers4208
viewsA: Random Numbers in Android Studio
There are several ways to do it. You can try using a Hashset, which is a collection of objects without repetition. Before assigning the values in the textviews, store in the Hashset, because the…
-
1
votes2
answers197
viewsA: According to Like does not work Sqlite
One more "name" item was missing in the array of the second parameter of the rawQuery method. It should look like this: new String[]{name, name}. For each "?" in the SQL string of the first…
-
0
votes1
answer548
viewsA: Opening a database in Sqlite instead of creating in Android Studio
Natively there is no way to send a populated . db file. I have also searched it. You have some options: 1) Use a library that does this (I found some, but never used) 2) Create the required Inserts…
-
-1
votes2
answers2211
viewsA: How to make INNER JOIN between tables on android Sqlite?
If you use the query() method, which only accepts a single table as an input parameter, you can create a view containing that Join and pass it to the method. If you use the rawQuery() method, you…
-
1
votes1
answer649
viewsA: Relationship 1:1
In your case, that the relationship of the tables is 1 to 1, I do not see much sense in being implemented separately. It could be all in one table: Produtos (id[PK], marca, categoria,...,…
-
0
votes1
answer55
viewsA: How to represent in the database (android sqlite), a class that extends another?
I am understanding that football is a type of exercise, so create a table "Football" and another "Exercise", each with its primary keys (id’s). In the Football table you must have a column (foreign…
-
1
votes1
answer271
viewsA: Elevation is not displaying the shadow
Place this parameter in the Linearlayout that is outside the Relativelayout that has Elevation. android:clipToPadding="false"
-
1
votes3
answers904
viewsA: Problem when rotating android cell screen
Activities on Android are destroyed and recreated when the screen rotates. You need to save the required data in a Bundle before it is destroyed in the onSaveInstanceState() method and then restore…
-
0
votes1
answer127
viewsA: Connection Android Studio Database Passing Date
Convert the date to milliseconds (long) and store it in your Map. You can create 2 utility methods to make this conversion. For example: public long DateInMillis(int year, int month, int day, int…
-
0
votes2
answers809
viewsA: Send data from a Fragment to an Activity
In theory it is not a good practice to send data from one Fragment directly to another Activity, because the principle of Fragment is to be reusable. For example, if you wanted to implement a…
-
1
votes1
answer47
viewsA: Error closing Intent.ACTION_VIEW
By the error he gave, his Alterarosfragment class does not appear to have an empty constructor, which is mandatory for Fragments. And I’m realizing that you try to initialize this class by passing a…
-
0
votes1
answer1077
viewsA: Cannot resolves Symbol
You did not set the parameter "id" with the value "activity_motion_event" in the XML Constraintlayout tag.
-
0
votes1
answer404
viewsA: Back to Canvas Ragment
I’m imagining that these features you mention are in other activities. Then when you leave the main Activity (which has the pager) it is destroyed and when you return to it, it is recreated (and in…
-
1
votes1
answer455
viewsA: Custom listview
To use a custom layout in Listview, you have to define a layout XML file representing a Listview line and write a custom Adapter for your list that will tell you how to place each data in the views…
androidanswered Márcio Oliveira 2,237 -
0
votes2
answers145
viewsA: I am unable to list my Sqlite data
The name of your column in the creation of the database has a typo: Gastotrasnporte And you’re trying to input data into the column that should be the right name Gastotransporte…
-
-1
votes3
answers1707
viewsA: Radiobuttons, horizontal and vertical layout
You have to leave all Radiobuttons inside a single Radiogroup and use a Viewgroup (Relativelayout, for example) to orgarnize the Radiobuttons the way you want them. Ficaria algo assim:…
-
1
votes1
answer29
viewsA: Get id Imageview on a Gridview
In place of IdAsString = arg0.getItemAtPosition(position).toString();; use: IdAsString = "" + imagens[position];
-
1
votes2
answers488
viewsA: Delay in loading Recyclerview
As the friend above quoted and looking at your code, you do not need to make that entire base load at once, it will only burden performance and device memory. Recyclerview was made precisely to work…
-
1
votes1
answer438
viewsA: Convert Activity to Fragments
Your Fragment should look something like this public class Fragment_perfil extends android.support.v4.app.Fragment { @Nullable @Override public View onCreateView(LayoutInflater inflater, ViewGroup…
-
0
votes1
answer24
viewsA: update list view after audio
After Recording file, you’re not updating your items array which is the data source of your Adapter. After recording a file, you are not updating your item array which is the data source of your…
-
0
votes3
answers705
viewsA: How to click on Listview
ListView listView; ... listView.setOnItemClickListener(new OnItemClickListener() { @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { // Faz o que…
-
0
votes1
answer137
viewsA: How to make Inserts in table creation in Sqlite?
You can do INSERT the same way you did with CREATE, passing the SQL command in the execSQL function. It is not recommended to make SQL queries directly from the application. The ideal is to work…
-
0
votes1
answer328
viewsA: Update Sdk Android Studio, Path profile!
In Settings -> Android SDK you can change the SDK installation path.
-
0
votes1
answer84
viewsA: Error with setOnTouchListener
As the above friend mentioned, said setContentView, which "inflates" the XML layout file in Java so that the UI objects can be instantiated. That’s why you made the "null Object" error, since JAVA…
-
2
votes1
answer92
viewsA: Importing the android project gives error in java.lang
The version of the buildToolsVersion (25) parameter is different from the versions configured in compileSdkVersion, targetSdkVersion and the support libraries in the dependencies (24). Try to leave…
androidanswered Márcio Oliveira 2,237