Posts by Cícero Moura • 1,070 points
50 posts
-
1
votes1
answer90
viewsA: Nullpointer Exception error when bringing Fragment data
We’re assuming you declared Fragment in the Activity xml, okay? Because if you haven’t, Fragment is not yet added to Activity. The second point is that Fragment may not be added to Activity where…
-
0
votes2
answers1571
viewsA: How to use Android Scrollview via Java code?
You can create an xml and call it scrollview.xml <?xml version="1.0" encoding="utf-8"?> <ScrollView xmlns:android="http://schemas.android.com/apk/res/android"…
-
0
votes1
answer574
viewsA: Animation on the Floating Action Button
Here is the answer: scale_fab_in.xml <?xml version="1.0" encoding="utf-8"?> <scale xmlns:android="http://schemas.android.com/apk/res/android" android:duration="500" android:fromXScale="0"…
-
0
votes1
answer574
viewsQ: Animation on the Floating Action Button
Does anyone know how to do the Floating Action Button animation shown in the video below? https://www.youtube.com/watch?v=oVKQfCZ3z2g&feature=youtu.be I decompiled the apk of this app and could…
-
0
votes2
answers564
viewsA: Listview too slow to load XML
Place NULL where you are BEFORE vi = mLayoutInflater.inflate(R.layout.empresa_item, parent, false); AFTERWARD vi = mLayoutInflater.inflate(R.layout.empresa_item, null, false); You can also exchange…
androidanswered Cícero Moura 1,070 -
2
votes1
answer832
viewsA: Standards for Android Development
There is no Google article telling you how to rename your Resources files. As in @Wakim’s comment, there is a Java code recommendations article only. You can follow the good tips of Patterns…
-
1
votes2
answers5861
viewsA: Change the line color of an Edittext
I believe that the most correct way would be to create a derivation of the main theme of the project to this screen, because if other changes are necessary in it, you don’t have to keep creating…
-
5
votes1
answer339
viewsA: How to create button in Android Behind code?
You can do both in XML and via code. The advantage of being via XML is that you don’t write as much in the code. Imagebutton: ImageButton imageButton = new ImageButton(this);…
-
0
votes2
answers805
viewsA: Asynctask task only runs once, then does not arrive at theInBackground
Friend, try not to use the same object for each run. Every time you run Asynctask Guide, instate a new object. I believe that way it will work normally. I’ve had similar problems and, researching, I…
-
1
votes1
answer108
viewsA: Problem Adding Image Inside a Thread
You can use an Asynctask and place the image manipulation part inside it. If the processing is not heavy, you can use a Uithread, as in the example below: [Sua Activity].this.runOnUiThread(new…
-
0
votes1
answer581
viewsA: Android app initializing with Side Drawer Menu always open
Switch to FALSE in this section ORIGINAL: mUserLearnedDrawer = sp.getBoolean(PREF_USER_LEARNED_DRAWER, true); WITH THE CHANGE: mUserLearnedDrawer = sp.getBoolean(PREF_USER_LEARNED_DRAWER, false);…
-
3
votes1
answer612
viewsA: Load spinner inside another
In your code, you are passing the callback event as context. Pass your Activity. @Override public void onItemSelected(AdapterView<?> arg0, View arg1, int posicao, long arg3) {…
androidanswered Cícero Moura 1,070 -
1
votes1
answer235
viewsA: Androidmanifest error on android:Theme
You simply don’t have a style file with the theme Apptheme avowed Create, inside the folder values, a file called Styles.xml. Paste this content into it. (The file name is arbitrary, IE, whatever...…
-
4
votes2
answers548
viewsA: Pass String array by parameter to tela2
Do so: Intent intent = new Intent(MainActivity.this, Tela2_Activity.class); intent.putStringArrayListExtra("itens",new ArrayList<String>( Arrays.asList(listaEstadoSelec)));…
androidanswered Cícero Moura 1,070 -
1
votes1
answer44
viewsA: Standard original XML file for a tooglebutton
Here it is: http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/4.4.2_r1/frameworks/base/core/res/res/drawable/btn_toggle_bg.xml @android:drawable/btn_default_small…
androidanswered Cícero Moura 1,070 -
2
votes1
answer339
viewsA: Make a flashing Imageview
Use this: Flicker.xml <?xml version="1.0" encoding="utf-8"?> <set xmlns:android="http://schemas.android.com/apk/res/android"> <alpha android:duration="500"…
androidanswered Cícero Moura 1,070 -
3
votes2
answers3969
viewsA: My App does not appear on Google Play on tablets
Check this in your APK, in Tips to optimize your app, in the Developer Console. Check this out too:…
-
1
votes1
answer204
viewsA: Title does not appear when an item is selected in the Navigation Drawer
I believe the error is here: @Override public void onDrawerClosed(View drawerView) { super.onDrawerClosed(drawerView); getActionBar().setTitle(drawerTitle); invalidateOptionsMenu(); } As much as you…
androidanswered Cícero Moura 1,070 -
2
votes1
answer60
viewsA: Error: Using 1.7 requires compiling with Android 4.4(Kitkat); Current using API 16
The language level you are using (Java 1.7) is available from the Kat Kit. If you want to continue using this language level, you must change the manifest to SDK 19. Otherwise, change the language…
-
2
votes2
answers1713
viewsA: I need to squeeze my layout when I open the keyboard
What you can do is put your layout inside a Scrollview and when the keyboard opens, the user can scroll the layout to see the information you want. Would look like this: <ScrollView…
-
1
votes1
answer538
viewsA: How to compose a Linear Layout in Activity using JAVA only
Real example: private ViewGroup createAlphabetTrack() { final LinearLayout layout = new LinearLayout(getActivity()); RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams((int) (30 *…
-
1
votes3
answers396
viewsA: Listview items losing color when using the scroll bar
Hey, buddy, here’s the deal: Every time you roll a Listview, items that "disappear" up or down are destroyed. Then, when they are recreated again, they return to their original state, without their…
-
2
votes1
answer357
viewsA: "stretch" line on tablelayout
Good, see that you are using Tablerow. Tablerow’s father must be Tablelayout, by the Google Guilds. Your Tablelayout, with multiple Tablerows inside, should be with Fill or match Parent in both…
-
1
votes1
answer301
viewsA: Change the background color of Actionbar with Tabactivity
What you can do is your inherit from Actionbaractivity. then you take getSupportActionBar() and add tabs. View documentation: http://developer.android.com/guide/topics/ui/actionbar.html…
-
1
votes1
answer77
viewsA: How to insert Droidsoapclient library into my Android application?
You must insert the . jar into the libs folder. Then right click on it and choose an option that is over at the end: Add as Libray Ready! Check this in the build.Radle file of the app (the above…
-
4
votes3
answers623
viewsA: What is the best way to share variables between 3 Activity’s?
You can create a session: public class App extends Application{ public static String photo_path; public static String audio_path; public static String commentary; } And access in any of the…
androidanswered Cícero Moura 1,070 -
1
votes1
answer311
viewsA: Limit access to the app in google play
The most correct thing is that you put in Play an application that manages the versions of your mobile system. You make this guy available on Play and when the user downloads, this application is…
-
2
votes2
answers128
viewsA: How to implement the verifyDeveloperPayload method?
I think here is very well explained :) http://codigo-google.blogspot.com.br/2013/02/implementar-in-app-billing-em-android.html…
-
1
votes2
answers128
viewsQ: How to implement the verifyDeveloperPayload method?
Does anyone know how to implement this function when working with Google Billing? I saw that a token should be generated for license check and prevent fraud. But someone knows how to implement, why…
-
0
votes2
answers672
viewsA: Identify Dual Sim Card on Android
I think that solves your problem import java.lang.reflect.Method; import android.content.Context; import android.telephony.TelephonyManager; public final class TelephonyInfo { private static…
androidanswered Cícero Moura 1,070 -
2
votes2
answers2277
viewsA: Read file in Assets folder
You can use a method like this: public static String getFileTextFromAssets(Context context,String[] pFolders, String pFileName) { // Stringbuilder que sera utilizado no processamento StringBuilder…
androidanswered Cícero Moura 1,070 -
0
votes2
answers728
viewsA: Action Imageview in Listview
Place the click event on the Adapter in your listview: See if that helps you. public class ListAdapter extends ArrayAdapter<Item> { public ListAdapter(Context context, int textViewResourceId)…
androidanswered Cícero Moura 1,070 -
5
votes1
answer560
viewsA: What are Android SDK Extras?
The Extras package available in the SDK Manager are libraries made available by Google to facilitate the development of applications that use some of their API, such as Google Maps, Google Billing…
androidanswered Cícero Moura 1,070 -
0
votes2
answers239
viewsA: Two Android Progressdialog one after the other
Do it like this: public static class OperationFiles extends AsyncTask<Void, Integer,Void> { public enum Operation { Move, Rename } private ProgressDialog progressDialog; private Context…
-
1
votes2
answers246
viewsA: Change variable in a task
Remembering that for you to use the onPostExecute you must pass the kind of result on the inheritance. 1) Assuming it is a String, it is the third parameter: extends AsyncTask<String, Void,…
androidanswered Cícero Moura 1,070 -
1
votes2
answers797
viewsA: Recover Data from a List View
You must implement the click of these buttons inside your Adapter: public class ListAdapter extends ArrayAdapter<Item> { public ListAdapter(Context context, int textViewResourceId) {…
-
0
votes3
answers16126
viewsA: Change text source from android APP
Here’s a great library for that ok. https://github.com/johnkil/Android-RobotoTextView
android-layoutanswered Cícero Moura 1,070 -
4
votes2
answers1997
viewsA: Chat with notifications in the app
Well, if your application queries an external database, you can, instead of doing a thread, do a service that does just what you said. The difference is that even with the application closed and the…
-
1
votes2
answers1597
viewsA: How to convert an image to hexadecimal?
First you must convert it to an array of bytes, then convert that array of bytes to hexadecimal. Check if this function helps you: final protected static char[] hexArray =…
androidanswered Cícero Moura 1,070 -
4
votes2
answers950
viewsA: How to make a manual system to check for new updates?
Well, basically I’ll give you an idea of how this works and you implement ok. You must have a server where there is a file that tells you which version is currently published. Example: In the root…
-
1
votes1
answer239
viewsA: How to open an actitivity from a java Fragment
If your ListView have an Adapter, put the event in the custom view (Row). But exemplifying your situation... Create the event within the OnCreateView() even. Consider the implementation of this…
-
0
votes3
answers152
viewsA: Android service runs only the first time
Put this implementation into your service: @Override public int onStartCommand(Intent intent, int flags, int startId) { // Este flag faz com que o sistema restart o serviço caso seja parado, tanto…
androidanswered Cícero Moura 1,070 -
0
votes2
answers125
viewsA: ERROR IN THE INBACKGROUND
Place the implementation of your function updateJSONdata(); to facilitate aid. At first, within threads other than runOnUiThread you should not manipulate views from the main thread (Activity)…
androidanswered Cícero Moura 1,070 -
1
votes2
answers813
viewsA: Creating a double array (not a multidimensional array)
Assuming you already make use of version 2 of Google’s Maps API, the goal here is to show how to search by addresses or coordinates (available at source) using either Google’s API for Android or the…
-
1
votes2
answers524
viewsA: How to know the remaining time for the alarm to ring
Good, in the simplest case of all, you can save in a preferences file the time set for alarm awakening. So, you take this time, simply subtract it from the current time to find out the remaining…
-
2
votes2
answers136
viewsA: Switch ellipsis style in Textview
Take a look at this class: Change the value of the ELLIPSIS variable import java.util.ArrayList; import java.util.List; import android.content.Context; import android.graphics.Canvas; import…
androidanswered Cícero Moura 1,070 -
1
votes1
answer90
viewsA: Problem with setImageViewUri widget
Implement these methods: @Override public void onReceive(Context context, Intent intent) { super.onReceive(context, intent); } public void onEnabled(Context context) { super.onEnabled(context); }…
androidanswered Cícero Moura 1,070 -
0
votes3
answers528
viewsA: Read file only by Java Android application
Basically you can put a non-existent extension to the files... if you don’t want anyone to open it and see what it is... Put some different names too: 523626.jpg => 523626.dat When your…
-
1
votes1
answer94
viewsA: API Level does not agree
Just give Build > Rebuild Project , in the case of Intelli J or Android Studio or Project > Build Project, in the case of Eclipse. Search how to use the ok appcompat-v7 library. With it you…
-
2
votes2
answers652
viewsA: Calling a function when a Fragment is closed
Do something like this... public class MeuFragment extends Fragment { private OnFragmentClosedListener onFragmentClosedListener; public OnFragmentClosedListener getOnFragmentClosedListener() {…