Back to project page LheidoSMS.
The source code is released under:
GNU General Public License
If you think the Android project LheidoSMS listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.lheidosms.receiver; // ww w . j av a2 s . c om import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import java.util.ArrayList; /** * Created by lheido on 01/11/14. */ public abstract class LheidoBaseReceiver extends BroadcastReceiver { protected Context mContext; protected String iAction; protected ArrayList<String> mActionsList; public LheidoBaseReceiver(){ mActionsList = initActions(); } @Override public void onReceive(Context context, Intent intent) { mContext = context; iAction = intent.getAction(); receive(intent); } public ArrayList<String> getActionsList() { return mActionsList; } public IntentFilter getIntentFilter(int priority){ IntentFilter filter = new IntentFilter(); filter.setPriority(priority != -1 ? priority : 2000); for(String action : mActionsList){ filter.addAction(action); } return filter; } protected abstract ArrayList<String> initActions(); protected abstract void receive(Intent intent); }