Posts by Leonardo Dias • 4,336 points
198 posts
-
4
votes3
answers317
viewsA: How to not distort the layout when opening the keyboard?
Fala Edu, Try to place this line inside your onCreate method: getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN); This will cause the layout to adjust without distorting,…
-
1
votes2
answers492
viewsA: force user to fill in edittext
Fala Carlos, You are inflating an xml with your actionBar items, correct? Something more or less like this: @Override public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {…
-
1
votes2
answers124
viewsA: Send data from one method to the other in the same Activity
You can pass as parameter in the method too, example: meuMetodo("Leonardo", "28 anos", "masculino"); And to receive: public void meuMetodo(String nome, String idade, String sexo){ //Aqui usa as…
-
1
votes1
answer1042
viewsA: Javascript works on Desktop but does not work on Android
Fala Eduardo, It would be good for you to post the code you are using in Java. But you’re probably using a webView, right? Make sure that after the webView statement, you’re putting this:…
androidanswered Leonardo Dias 4,336 -
1
votes2
answers467
viewsA: Nav Header with login
Fala Artur, You’d better treat it directly in Java, when the user logs in, you save it to the local database, right? Before setting this name and email values of the logged in user, you make an if,…
-
0
votes0
answers36
viewsQ: Create Mask in Framelayout
Fala galera, I have an image, and I’d like to create a mask, but I’m having a hard time. 1- I have this image 2- I would like to not touch the original size of the image, and present only a piece of…
-
3
votes1
answer240
viewsA: How to change the text size and padding tabs in tabHost?
Fala Daniel, You need to create a theme for your Activity that has tabHost la on Androidmanifest.xml, example: <activity android:name="MyTabActivity" android:theme="@style/CustomTheme"> Done…
androidanswered Leonardo Dias 4,336 -
1
votes2
answers896
viewsA: Custom android camera
Fala Vinithius, You need a camera attached to a Fragment, do the following: 1- Create a Fragment, and in its layout, add a Framelayout: <FrameLayout android:id="@+id/camera_container"…
-
1
votes1
answer51
viewsA: Help To Cancel Asynctask
Fala Ronaldo, You need to declare Asynctask first: private YourAsyncTask mTask; To start her off: mTask = new YourAsyncTask().execute(); To force the tide: mTask.cancel(true); Hugs.…
androidanswered Leonardo Dias 4,336 -
0
votes1
answer84
viewsA: How to upload a video to a screen?
You can use a webView, for example: WebView myWebView = (WebView) findViewById( R.id.webview_compontent ); String playVideo= "<html><body>Youtube video .. <br> <iframe…
-
0
votes1
answer38
viewsA: Doubt with component change in eclipse migration to android studio
Give a check in your file build.Gradle inside the directory app, see if you have these inlets on the dependencies: compile 'com.android.support:appcompat-v7:22.2.1' compile…
-
1
votes1
answer68
viewsA: Recyclerview reuse of View
Fala Thiago, I suffered a lot when I started working with Recyclerview. As its name says, it reuses the cells that have already been created. Probably, you do an if to appear the button, right?…
-
0
votes2
answers498
viewsA: Blocked installation when debugging app by Android Studio
Fala Heris, Looking at your code, I believe what you’re blocking is this: <uses-permission android:name="android.permission.DOWNLOAD_WITHOUT_NOTIFICATION" /> What is the function of it? You…
-
0
votes1
answer40
viewsA: How to fix Mpandroidchart value is over when it is 0
Fala Rafael, You want to show on the chart even when the value is 0? Because you can add to the chart, only when the value is greater than 0, example: if(value > 0){ dataSet.add(...) } else { //…
-
-1
votes1
answer29
viewsA: Gray button on an old version of Android
You better post the XML with the buttons. But if you are setting the images of it through a src: android:src="@drawable/imagem" Then seven the background to null: android:background="@null" Will…
-
2
votes1
answer750
viewsA: Put Button at the bottom of the screen - Android
Fala Tiago, You will need to create an interface class: public interface ScrollViewListener { void onScrollChanged(ScrollViewExt scrollView, int x, int y, int oldx, int oldy); } Once done, you’ll…
-
1
votes2
answers308
viewsA: Delete an editText when modifying another
Fala Edu, You can check if the field is empty, and then delete the second field, example: if(TextUtils.isEmpty(campoX1)) { campoX2.setText(""); return; } If field 1 is empty, the second will also…
-
-2
votes2
answers215
viewsA: Save data from a web service to a global variable on Android
Fala Gabriel, You must create a class that extends Application, example: public class MyApplication extends Application { private String someVariable; public String getSomeVariable() { return…
-
3
votes1
answer642
viewsA: How to call a method that is inside my Fragment through the onclick of a button that is also inside the Fragment?
You need to use the Onclicklistener on the button, this way: botao.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { mostrarMsg("Titulo teste", "Mensagem…
-
0
votes1
answer41
viewsA: Notifications stop appearing and gives console error
Fala Tiago, You’d better post the code here, to understand where you might be missing, but try to do the following: Change: Notification.Builder mbuilder = new Notification.Builder(this) For:…
androidanswered Leonardo Dias 4,336 -
2
votes1
answer224
viewsA: Change the color of the application footer
Fala Henrique, According to this image, this is the coloring order of your application: There in his xml style. where you declare the colors, just add: <item…
-
3
votes2
answers69
viewsA: Alternative to Absolut Layout
Fala Gustavo, When you use Relativelayout, you must specify which item is on top of which, for example: <TextView android:id="@+id/name_dias" android:text="Leonardo Dias"…
-
9
votes2
answers10977
viewsA: SDK Command Facebook Android - Key hash
There are a million ways to retrieve this Key Hash. It serves to identify that only your project is accessing the user’s Facebook information, as security even. I always broke my head to get that…
-
2
votes4
answers6185
viewsA: What is the difference between match_parent and fill_parent?
The fill_parent is no longer used, it is obsolete. It was replaced by match_parent, you can even use the fill_parent, but it can happen some "defects" in the application. Then it is better to use…
-
1
votes1
answer24
viewsA: How to prevent the line from losing the color reference in Expandablelistview?
Fala Daniel, Put your code here, it’s better to help you. But probably your problem is that you make an IF to color the lines right? So you need to put a ELSE for standard color, example: if(filho…
-
0
votes1
answer875
viewsA: Webview Javascript calling java method - android
Fala Gustavo, Try to change that line: webView.addJavascriptInterface(this, "android"); For that reason: webView.addJavascriptInterface(new MyJavaScriptInterface(), "HTMLOUT"); And out of your mind,…
-
0
votes2
answers1630
viewsA: Limit image size without cropping
Try to put this line in your imageView statement in XML: android:adjustViewBounds="true" This will cause the image to auto fit in the layout.
-
4
votes0
answers72
viewsQ: Apply a Transform with perspective
I would like to make the selection by perspective in a imageview. Where I select the 4 corners of the image and cut, following this idea: I searched all day and found little thing, I found this link…
-
0
votes1
answer31
viewsA: Send selected photo in the gallery to the bank along with form, using web service php
Fala Juliano, To do this service, you must first transform the chosen image into Bytearray and save it to the user’s device. After done these two steps, ai yes you can upload it through a web…
androidanswered Leonardo Dias 4,336 -
0
votes2
answers673
viewsA: App name does not appear in emulator equal appears when I’m fiddling with code
Fala Jefferson, On your Androidmanifest.xml, you should set the activity label, for example: <activity android:name=".MainActivity" android:label="@string/titulo_da_tela" > </activity>…
-
1
votes2
answers1659
viewsA: Send notification message to app
This service is called Push Notification (Cloud Messaging), there’s no way I can explain it to you with codes because it’s a very long service. In the Android documentation, there is a very…
-
2
votes2
answers49
viewsA: Aid to create the first android project
Fala André, Probably this error in the project name, it must be because you are starting it with lowercase letter. But I advise you to retire Eclipse and install Android Studio. It is the own…
androidanswered Leonardo Dias 4,336 -
1
votes1
answer210
viewsA: How to put a layout for each tab bar action
Fala Diego, You define it in the method public fragment getItem. Thus: @Override public Fragment getItem(int position) { switch (position) { case 0: FragmentListView tab1 = new FragmentListView();…
-
0
votes1
answer32
viewsA: Imageviewpageadapter cannot be Applied error
Fala Rico, Probably the problem is in your Viewpager statement. Do the following, declare a View: private View rootView; Now, change your own: public View onCreatedView(LayoutInflater infl,…
-
-1
votes1
answer213
viewsA: Error loading gallery or camera image
This is Osvaldo, try to use this code below, for me it works on all smartphones: private String selectedImagePath = ""; final private int PICK_IMAGE = 1; final private int CAPTURE_IMAGE = 2; public…
-
1
votes2
answers282
viewsA: Like timing an Interstitial ad?
Fala Francis, Try to do it that way then: interstitialAd.setAdListener(new AdListener() { public void onAdLoaded() { Handler handler = new Handler(); handler.postDelayed(new Runnable() { public void…
-
0
votes2
answers131
viewsA: Error closing Progressidialog
Fala Fabio, No error in logCat? I imagine the problem lies in that part: finally { closeProgress(); } Try to remove that part, it might solve. Hugs.…
-
2
votes3
answers852
viewsA: Cache.properties, file not found
Hello, follow these steps to resolve your problem: Go to the directory C: Users Didi&lulu . Gradle caches 2.10 Copy the folder scripts and save somewhere in case you need of her back after;…
-
1
votes1
answer1008
viewsA: Error inflating class android.support.design.widget.Navigationview
Fala Giancarlo, Try to add the item app:itemTextColor="@color/a_color" to your Navigationview, will stay that way: <android.support.design.widget.NavigationView android:id="@+id/nav_view"…
-
0
votes1
answer85
viewsA: Smsmanager on Dual Sim phones
Fala Italo, I believe this is a function chosen directly on the user’s device. It is possible to define which YES will be the standard of calls and sending SMS, to revoke this permission, in the…
-
1
votes1
answer301
viewsA: Tabbar Android how to create
This scheme with the tabs Whatsapp, It is called Viewpager. You can see an example of the codes and even download a project and import in your Android Studio to see how it is done, in the Android…
androidanswered Leonardo Dias 4,336 -
2
votes3
answers2658
viewsA: Knowing that a button has been clicked
Fala Henrique, You can use the property Boolean: You declare a variable of type Boolean, with the name clicked and the default value as false; private boolean clicked = false; Then, inside the…
androidanswered Leonardo Dias 4,336 -
1
votes1
answer532
viewsA: Listview does not appear
Fala Tiago, The problem is when you declare these TAGS, they are not being identified by Simpleadapter. I did a test here and it worked, declare your To and From as follows: String[] from = new…
androidanswered Leonardo Dias 4,336 -
3
votes1
answer168
viewsA: Website does not open in my Webview
You need to define where it will open, for example: WebView myWebView = (WebView) rootView.findViewById(R.id.webView); myWebView.getSettings().setJavaScriptEnabled(true);…
-
5
votes1
answer2312
viewsA: java.lang.Illegalstateexception: You need to use a Theme.Appcompat Theme (or Descendant) with this Activity
Check your Androidmanifest.xml. In the statement of this activity: Alteraratendenteactivity.java Check which theme you’re using on it, for example: android:theme="@style/AppTheme.Theme.AppCompat"…
androidanswered Leonardo Dias 4,336 -
0
votes2
answers582
viewsA: Change Toolbar Back Button Color
Fala Vinicius, It’s good you always post the code you’re using, to avoid being negative! Suppose you are declaring your Toolbar in this way: Toolbar mToolbar = (Toolbar) findViewById(R.id.toolbar);…
-
1
votes1
answer906
viewsA: How to create backups of a project in Android Studio?
Fala Linkon, The best way is to create an online repository, the most used for Androis projects are Github and Bitbucket, follow the links: Github: https://github.com/ Bitbucket:…
-
1
votes1
answer2683
viewsA: How to Access Real-Time Android Sqlite Data (DEBUG)
Fala Felipe, That was a doubt I always had, posted in thousands of places and forums and nothing! What I got was a method, which exports the file .comic of Sqlite, and with this file I can view it…