Java

Dedicated to the discussion of the Java programming language a...
Jul 12, 2020 17:01
Hi
 

Android & Kotlin Experts

Any SO Room is nothing without you all GUYS.Thanks to all memb...
Aug 10, 2016 07:18
Is my approach is correct to refresh the List View......



@Override
protected void onResume() {

List<ProcessMaster> updatedMasters = new ProcessMasterRepository().getUserFormsForTemplate(formTypeId);
Log.d("RESUME","Value in Old "+masters.size()+" Value in New "+updatedMasters.size());
masters.removeAll(new ArrayList<Object>(masters));
masters.addAll(updatedMasters);
mAdapter.notifyDataSetChanged();super.onResume();

}
Aug 10, 2016 07:18
Hey Buddies,
Aug 10, 2016 06:13
@Kaushik Thx buddy will do experiment that with my needs.
Aug 10, 2016 06:09
Hey Buddy @jafarbtech Thx for suggesting grid view and time you taken to help me out... I made a big mistake using GridLayout.. After replacing it with GridView.. it smooth... :)
Aug 9, 2016 15:48
Thanks @Shubhank & @jafarbtech... You guys awesome
Aug 9, 2016 15:28
@Shubhank Thx buddy that would help
Aug 9, 2016 15:23
This is the first time am using grid view.. Please bear with my stupid question
Aug 9, 2016 15:23
@Shubhank, I dont know what u referring as model here..
Aug 9, 2016 15:17
Though I am not a fan of Inner classes, I am listening for better approach
Aug 9, 2016 15:16
@jafarbtech and that works fine..
Aug 9, 2016 15:14
As a dirty fix, I moved the Adapter implementations as inner class to main activity and kept a Global Variables
Aug 9, 2016 15:13
S dude
Aug 9, 2016 14:42
getExtra is written with in the onActivityResult
Aug 9, 2016 14:42
and i used putExtra of GalleryIntent.... When I tried to access the value in the getExtra it returns nothing.. I mean not the actual value...
Aug 9, 2016 14:39
@Shubhank same class but mutlipe instances .. One for each
Aug 9, 2016 14:34
@Shubhank & @jafarbtech please see the linked pastebin content
Aug 9, 2016 14:34
Aug 9, 2016 14:22
Yeah ... preparing pastebin content
Aug 9, 2016 14:21
Let me post sample of my code and give detail of what I need
Aug 9, 2016 14:17
yeah @Shubhank --- right* :)
Aug 9, 2016 14:11
As I have multiple gridviews, how can I pick the rit adapter
Aug 9, 2016 14:06
@jafarbtech
Aug 9, 2016 14:06
@jaf
Aug 9, 2016 14:06
I am calling startActivityForResult in the adapter, and having onActivityResult in the main activity... How do I pass the value from adapter to activities onActivityResult method
Aug 9, 2016 13:54
Anybody here !
Aug 9, 2016 07:32
@jafarbtech thx for your response buddy.. Will try this one now and will post the update soon. Thanks @Dev
Aug 9, 2016 07:31
@jafarbtech said , there will be scrolling issue
Aug 9, 2016 07:31
@Dev thnx for responding buddy, as @jaf
Aug 9, 2016 07:30
@jafarbtech I think that answers my question.. So I will gave the visibility of my Image LIst and the adapter instance..
Aug 9, 2016 07:30
@jaf
Aug 9, 2016 07:26
GridView gv;
for ( int i = 0 ; i< 5; i++){
gv = new GridView (this);
GridViewAdapter gridAdapter = new GridViewAdapter(this, R.layout.img_grid_item_layout, getData(id));
gv.setAdapter(gridAdapter);
}
Aug 9, 2016 07:25
@jafarbtech, I will create three GridView each having new adapter instance bind to it. as written below...
Aug 9, 2016 07:24
not exactly, When I have 3 grid views like in the image ibin.co/2qt8gyEx8B5H.png
Aug 9, 2016 07:14
One confusing part, assume I have three grid view, and three instance of adapters, one for each...... How would I get the adpater of second grid view to add one item !.... Should I need to maintain a map !
Aug 9, 2016 07:11
The data will be bound to the adapter ... So do you think, this is the one feasible approach !
Aug 9, 2016 07:07
Just a prototype to experiment this..
Aug 9, 2016 07:06
GridView gv;
for ( int i = 0 ; i< 5; i++){
gv = new GridView (this);
GridViewAdapter gridAdapter = new GridViewAdapter(this, R.layout.img_grid_item_layout, getData(id));
gv.setAdapter(gridAdapter);
}
Aug 9, 2016 07:05
for ( int i = 0 ; i< 5; i++){
Aug 9, 2016 07:04
New instance of adapter wlll be used rit !
Aug 9, 2016 07:04
I never used grid view , so thinking about use that nw.. Before wasting my time, I thought I can reach out to community ...
Aug 9, 2016 07:03
That worked ok for displaying the image.. but later on when I have to add / change / delete them the work gets complex and the code gets noisy..
Aug 9, 2016 07:01
right!..
Aug 9, 2016 07:01
The adapters as I have to add or delete content in it....
Aug 9, 2016 07:01
Initially I tried to go with Grid Layout
Aug 9, 2016 06:56
@jafarbtech @PriyankaMinhas @Shubhank ...!
Aug 9, 2016 06:55
No one in here.. :(
Aug 9, 2016 06:52
Something just like in the bin
Aug 9, 2016 06:52
I would like to know a way to implement multiple grid view in a same activity to add images on each , also should be able to remove the added / change the added image...
Aug 9, 2016 06:50
Hey all