Posts by João Gouveia • 319 points
7 posts
-
7
votes1
answer840
viewsA: How to make tabs similar to Whatsapp?
In the case of Whatsapp I imagine that a Tablayout and a Viewpager are used: XML: <?xml version="1.0" encoding="utf-8"?> <LinearLayout…
androidanswered João Gouveia 319 -
5
votes2
answers1282
viewsA: How to run my App on multiple platforms
There are 2 "types" of applications, the Natives and the Hybrids. Natives : Native apps have standard languages and frameworks, for example, in the case of Android is used Java(or Kotlin), XML and…
-
1
votes3
answers153
viewsA: Passage of values between Fragment and Activity
You can create a variable in your Activity, in addition to a Setter, and "settar" its value from within the Fragment: public class MyActivity extends Activity { private String horoscopo; public void…
androidanswered João Gouveia 319 -
0
votes1
answer378
viewsA: Show Image in Imageview
To access the mobile gallery is used a Intent android standard: Intent pickPhoto = new Intent(Intent.ACTION_PICK, MediaStore.Images.Media.EXTERNAL_CONTENT_URI); startActivityForResult(pickPhoto,…
androidanswered João Gouveia 319 -
1
votes1
answer5357
viewsA: How to center the entire layout
Try to use the parameter android:gravity="center_vertical" in the parent Linearlayout. If you want to adjust each View separately, you can use the parameter android:layout_gravity in the desired…
-
1
votes1
answer4030
viewsA: java.lang.Nullpointerexception: Attempt to invoke virtual method on a null Object Reference
1 - It is important to give myDB.close(), if not the connection to the bank is open forever, costing the device 2 - Do not be afraid to instantiate the bank more than once. null Pointer is appearing…
-
3
votes1
answer734
viewsA: How to call Fragments in Drawernavigation?
The ideal is that the layout of your Activity has as one of its elements something that serves as "container", it is very common to use a Framelayout for these cases. So create an Activity method…
androidanswered João Gouveia 319