android - How can I update the all the views inside a TabHost when pressing on a ContextMenu item from within one of the views? -
i implementing music player application in android. play list selection screen implemented tab selector widget contains listactivity inside each of tabs: artist, albums, songs. want update listview in each of listactivity when delete item of lists.
i.e. when long press item in artists list context menu drawn "delete artist" , should delete songs artist in songs listview, delete albums artist in albums listview, , delete entry artist in artist listview.
each of listactivity has own filldata() method, updates listview when button in context menu pressed.
how can call filldata() method of albums listactivity after update listview inside of artists listactivity?
the solution have delete action broadcast update message
public static final string refresh_data = "package.music.refresh_data"; intent myintent = new intent(refresh_data); myintent.putextra("type","refresh_data"); sendbroadcast(myintent);
and in activities inside tabs have
private broadcastreceiver mrefreshdatareceiver = new broadcastreceiver() { @override public void onreceive(context context, intent intent) { setdata(); } };
(remember register oncreate() , deregisterit on destroy
Comments
Post a Comment