Posts by porthfind • 731 points
40 posts
-
2
votes1
answer77
viewsQ: Android: How to get username in Google Play Games
I’m developing a game and after the player does the sign in is redirected to another in-game activity. My problem is that I don’t know how to get the username of him in that activity in which he…
-
0
votes1
answer56
viewsA: Android error "android.app.Application does not implement Dagger.android.Hasactivityinjector"
I solved my problem by putting app:name in the Manifest.xml
-
0
votes1
answer56
viewsQ: Android error "android.app.Application does not implement Dagger.android.Hasactivityinjector"
I am trying to run my app and every time I click a button and go to the Extended activity I get the following error: Process: com.converter.android.dailycope, PID: 28573 java.lang.RuntimeException:…
-
1
votes5
answers3128
viewsA: How to get Firebase data and insert it into a Textview?
If you just want to get the value of the email, you should do: DatabaseReference ref = FirebaseDatabase.getInstance().getReference("usuarios"); DatabaseReference clientesref = ref.child("clientes");…
-
1
votes2
answers66
viewsA: Email and password in the Android Studio app not registered in Firebase
I don’t see any problem with the code. Maybe what’s missing is enabling the email/password authentication option in Firebase.…
-
1
votes0
answers90
viewsQ: Android: Error in getcontext() when using Sharedpreferences
I’m using SharedPreferences with Retrofit2 and notificações. Each time the Notification is executed I get the exception "'java.lang.String android.content.Context.getPackageName()' on a null object…
-
1
votes1
answer34
viewsQ: Android: Error using Retrofit with XML converter
I’m making a simple example of Retrofit on Android with an XML converter, but every time I run I get the following exception: java.lang.RuntimeException:…
-
0
votes1
answer894
viewsQ: Registration confirmation email with Firebase
I’m trying to use the method sendEmailVerification() of Firebase after registration of the user through the Login by e-mail. My problem is that I do not have the option to use this method after…
-
2
votes1
answer323
viewsQ: How to place line to split items in a Spinner?
I’m trying to place a line dividing the items I have in a Spinner but I can’t seem to get it out. spinner_item.xml <?xml version="1.0" encoding="utf-8"?> <TextView…
-
1
votes1
answer22
viewsQ: Android: Have a job to check url
I need to have a job for an app of mine that runs every day to check if a URL is returning correct data. In case I don’t return it, I should get an e-mail. Does anyone have any idea how to do this?…
-
2
votes1
answer75
viewsQ: I can’t put hamburger symbol on Navigation Drawer Panel
I’m trying to put one navigation Drawer Panel in my app, but I can’t put the burger symbol on my MainActivity. The code I’m using is: public class MainActivity extends AppCompatActivity implements…
-
1
votes2
answers96
viewsA: Change language in the app and stay changed
Putting a database is an option, but I don’t think it’s justified if it’s just to save the language. Research on Sharedpreferences, which is another way to store data and works through {key, value},…
-
3
votes1
answer6619
viewsQ: Button with image and text
I have a button that has round borders and when it is selected changes color. A certain text is associated with that button. It turns out I want the button to have an image plus the text and I can’t…
-
2
votes2
answers156
viewsQ: Calling an internal class method from outside
I have a class B and in that class I need to call a method, getSomething(type, option), which is defined in a class A which is a class which extends AsyncTask and which is within Class C. My Class C…
-
0
votes3
answers153
viewsA: Passage of values between Fragment and Activity
The only thing missing from my fragment that I discovered later was: dismiss() so he disappears when you press the button.
-
3
votes3
answers153
viewsQ: Passage of values between Fragment and Activity
I have a fragment that consists of several buttons. The goal is that when I press one of these buttons the fragment disappear and pass the value associated with that button to the activity that is…
-
0
votes1
answer80
viewsQ: Android: How to clear space between each entry in a Spinner?
I have a spinner where I intend to name the horoscopes. However, the name of horoscopes appears with a blank line separating each horoscope when I "open" the spinner. Something like this: -linha em…
-
7
votes2
answers4969
viewsQ: Android: read JSON data
I have a url that gives me the data in this format: {"to": "DKK", "rate": 7.4417, "from": "EUR"} I’m trying to read them this way: JSONObject obj = new JSONObject(); JSONObject obj2 =…
-
1
votes1
answer1143
viewsQ: View BD Sqlite on Android Device Monitor
I’m trying to view my BD Sqlite on Android Device Monitor, but in the folder data, I don’t see any files to export and so I can’t see my BD. What could I be doing wrong?…
-
0
votes0
answers55
viewsQ: Save Data from Notification
I’m trying to implement a Notification daily. The time of this Notification is chosen by the user through a TimePicker that appears when clicking on a LinearLayout consisting of 2 TextViews where…
-
0
votes1
answer103
viewsQ: Linearlayout with 2 textViews to simulate a button
My goal is to have one Button with 2 TextViews inside. So I researched the easiest way is to have a LinearLayout and inside place the TextViews and place the property android:clickable="true". The…
-
0
votes1
answer54
viewsQ: Add items to an Expandable List
I’m trying to use an Expandable List. In this Expandable List I intend to put as header "the categories of my products" and in the children items put "my products". However I’m getting the error…
-
2
votes1
answer1896
viewsQ: Android: getApplicationContext()
I’m trying to do Database db = new Database(this.getApplicationContext()); Where Database is a class I have with all the methods related to Database and I’m calling to fill an Expandablelist.…
-
1
votes2
answers205
viewsQ: Create table in Sqlite with array
I am creating a Sqlite Database and I have 2 tables, a LIST table and other PRODUCTS. The LIST table beyond the fields ID numeric, NOME text, has a PRODUCTS ARRAYLIST. Already the PRODUCTS table…
-
2
votes2
answers5006
viewsQ: How to put a row to separate items from a menu?
Hello, someone knows how to place a horizontal line to separate items from my menu without having to use the tag <group>? I have the following code: <menu> <item…
-
1
votes3
answers1106
viewsA: How to view query result in Sqlite?
Cursor cursor; select_query = "SELECT a,b,c FROM table"; cursor = db.rawQuery(select_query, null); if(cursor.getCount()>0){ while (cursor.moveToNext()) { //se a select devolver várias colunas…
-
1
votes0
answers48
viewsQ: Update activity from Alertdialog
Every time I click on Toolbar I have a menu that when clicking on one of the options I see a AlertDialog. This Alertdialog has a setSingleChoiceItems, where the user choosing an option and clicking…
-
0
votes1
answer1908
viewsQ: Android:get value from Radiobutton
Hi, I have a problem I can’t solve. I have a dialog where I have a RadioGroup with 2 Radio Buttons and a button OK. I want to get the radio button value selected when I click OK, but I’m getting the…
-
3
votes1
answer256
viewsQ: Toolbar with separator at the bottom
I’m using the Toolbar, but wanted the bottom of it to have a line of another color that delimited it, as shown in the image, To achieve this effect the only thing I remember is using a ImageView. Is…
-
1
votes1
answer3710
viewsQ: Center background image
I am trying to put as background image an image that I want to be exactly centered vertically and horizontally (the image is a ball). So the goal is to stay horizontally match_parent and vertically…
-
0
votes1
answer627
viewsQ: How to get current month with getDisplayName
I intend to get the current month and for that I am using the following code: Calendar calendar = Calendar.getInstance(); String mes = calendar.getDisplayName(Calendar.MONTH, Calendar.LONG,…
-
2
votes1
answer164
viewsQ: Android: how to group buttons?
Hello, in my application I have a textview with a question and then I have 3 buttons that are the possible options for the answer. Can anyone tell me how to group these 3 buttons to have a kind of…
-
4
votes3
answers2310
viewsQ: Keyboard hides Edittext
I have an activity with a EditText to enter values. Whenever the keyboard appears, the editText (the keyboard hides the EditText). I tried to put in the Manifest in the relevant activity the…
-
5
votes2
answers4578
viewsQ: Android Toolbar: center title
I’m trying to center the title of mine Toolbar but I can’t. I’ve tried to use Theme (did not work) and I have tried in Java code (however in Java code as I am using the API 13, can’t use the…
-
1
votes1
answer1070
viewsQ: Change Actionbar Menu Background
Ola, there is some way to change in XML the background color of the options menu that appears in ActionBar?
-
1
votes0
answers59
viewsQ: How to handle Actionbar’s options?
Hello, in the app I am doing all my activities (except 2) has the extends of another Activity (BaseActivity) where I treat the options available on ActionBar, with this I avoid repeating the code in…
-
1
votes1
answer475
viewsA: How do I change the color of cardview after a longclick on it?
You’ve tried this before? <--your object-->.setOnLongClickListener(new View.OnLongClickListener() { //<--your object-->deve ser substituido pelo cardview em que se faz o clik. @Override…
-
1
votes2
answers215
viewsA: Problem with XML Linearlayout
I’ve already had this problem... to get the desired look, you should create two layout files, one for the elements of your list, and one for the activity. The layout for each element of your list…
-
2
votes1
answer246
viewsQ: Android: Exception when running Toast.makeText
Ola, I am getting an exception when the Toast.makeText: public void onClick(View view){ (...) CharSequence text1 = "Please insert a number."; int id= view.getId(); (...) else if(id== R.id.buttonOK){…
-
1
votes1
answer337
views