Android Open Source - generalsbuzz Update Rows Receiver






From Project

Back to project page generalsbuzz.

License

The source code is released under:

MIT License

If you think the Android project generalsbuzz listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package me.kworden.wlcalendar2.receiver;
/*from   w  w  w. j a  va 2 s. c  om*/
import java.util.ArrayList;

import me.kworden.wlcalendar2.MainActivity;
import me.kworden.wlcalendar2.R;
import me.kworden.wlcalendar2.adapter.EventAdapter;
import me.kworden.wlcalendar2.fragment.EventDisplayFragment;
import me.kworden.wlcalendar2.struct.WLEvent;
import me.kworden.wlcalendar2.util.APP;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.widget.ListView;

public class UpdateRowsReceiver extends BroadcastReceiver
{
  private EventDisplayFragment m_fragment;
  
  public UpdateRowsReceiver(EventDisplayFragment p_fragment)
  {
    m_fragment = p_fragment;
  }
  
  @Override
  public void onReceive(final Context p_context, Intent p_intent)
  {
    if(p_intent.getExtras() != null && p_intent.getExtras().containsKey("EVENTS"))
      m_fragment.setEvents((WLEvent[])p_intent.getExtras().getParcelableArray("EVENTS"));
    
    ArrayList<WLEvent> t_events = new ArrayList<WLEvent>();
    for(WLEvent i_event : m_fragment.getEvents())
      t_events.add(i_event);
    
    final ListView t_lv = (ListView)m_fragment.getView().findViewById(R.id.main_events);
    EventAdapter t_event_ad = new EventAdapter((MainActivity)m_fragment.getActivity(), t_events);
    
    t_lv.setAdapter(t_event_ad);
    t_lv.setClickable(true);
    t_lv.setSelectionFromTop(APP.scrollPos[0], APP.scrollPos[1]);
  }
}




Java Source Code List

me.kworden.wlcalendar2.BuildConfig.java
me.kworden.wlcalendar2.BuildConfig.java
me.kworden.wlcalendar2.MainActivity.java
me.kworden.wlcalendar2.SettingsActivity.java
me.kworden.wlcalendar2.adapter.EventAdapter.java
me.kworden.wlcalendar2.async.CheckLocalDataTask.java
me.kworden.wlcalendar2.async.ParseDataTask.java
me.kworden.wlcalendar2.async.ReadLocalDataTask.java
me.kworden.wlcalendar2.async.RequestRemoteDataTask.java
me.kworden.wlcalendar2.async.StoreDataTask.java
me.kworden.wlcalendar2.fragment.EventDisplayFragment.java
me.kworden.wlcalendar2.fragment.EventInfoFragment.java
me.kworden.wlcalendar2.fragment.SettingsFragment.java
me.kworden.wlcalendar2.receiver.CheckLocalDataReceiver.java
me.kworden.wlcalendar2.receiver.RequestRemoteDataReceiver.java
me.kworden.wlcalendar2.receiver.UpdateRowsReceiver.java
me.kworden.wlcalendar2.struct.MonthYearParcel.java
me.kworden.wlcalendar2.struct.WLEventClassifier.java
me.kworden.wlcalendar2.struct.WLEventLinebreak.java
me.kworden.wlcalendar2.struct.WLEvent.java
me.kworden.wlcalendar2.struct.WLHeader.java
me.kworden.wlcalendar2.util.APP.java
me.kworden.wlcalendar2.util.BROADCAST.java
me.kworden.wlcalendar2.util.MD5.java
me.kworden.wlcalendar2.util.PATTERNS.java
me.kworden.wlcalendar2.util.STATUS.java