Posts by Guilherme Ramos • 343 points
10 posts
-
1
votes1
answer161
viewsQ: Viewholder Pattern in an Activity
Let’s assume that I have an Activity with its layout and, using the Butterknife and the Viewholder Pattern, I create a nested class in which I pass the View root and inject the Butterknife in it.…
-
2
votes2
answers355
viewsQ: Advantage in giving null in a variable on Android
Assign the value of null in a variable on Android can improve application performance? As far as I know, in Java we have the Garbage Collector, and in Android, the activity cycle of Activities and…
-
0
votes1
answer513
viewsQ: Static, private and final variables
I have a doubt that has been troubling me for a long time: What is the advantage of creating a static and final variable (both private and public)? If I have a primitive variable or simple classes…
-
1
votes1
answer58
viewsQ: Static objects in Activities with View Pagers
I have an Activity with a view pager, and this one controls three fragments, F1, F2, F3. The F1 fragment shows user-added items, the F2 fragment loads all items from an external server, showing them…
-
0
votes2
answers675
viewsQ: How to modify and save the new modified listview item?
I would like to know how to save multiple positions from a listview. As an example, let the user bookmark certain list items. I don’t know what would be useful to get an efficient response, so I…
-
0
votes2
answers1734
viewsA: How to pass data from a Pager/Fragment to another Activity?
Well, the best I could do so far, and what I consider as an answer to my question, was to create a sharedPreferences inside viewPager, thus: public static class PlaceholderFragment extends Fragment…
-
1
votes2
answers1734
viewsQ: How to pass data from a Pager/Fragment to another Activity?
I’m creating an Activity that possesses Swipe Views (Viewpager) and I would like to know how to pass data from Ragment to another Activity, since static methods are always requested. For example,…
-
9
votes1
answer5967
viewsQ: What’s the difference between drawing in Activity and in Fragment?
After the last SDK update in Eclipse, when creating a new project, a fragment next to activity_main. I would like to know why the fragment, since before it opened directly to activity_main. Is there…
-
7
votes2
answers4442
viewsQ: How to delete a specific Listview item?
I would like to ask a question: I have one ListView, in which his Adapter is clarified in the same Activity and the content of Adapter (as strings) are in another class, in another package. How do I…
-
2
votes1
answer894
viewsQ: Hello World on Android consuming a lot of RAM
I’m doing an application and I noticed that it is consuming a lot of RAM, approximately 70MB. I have a button that inflates an extra layout with random data and that keep changing dynamically that…