Hey. I am new to Android trying to create an IntentFilter that can filter multiple actions. Unfortunately, when I start using the method addAction, Eclipse throws an error:
"Syntax error on token" addAction ", Identifier expected after this token"
although I imported the required file. This is probably a configuration issue, although I'm not sure if the rest of the code shows any problems.
Here is my code stub:
import android.content.Intent;
import android.content.Context;
import android.content.IntentFilter;
...
private Context mContext;
IntentFilter filter = new IntentFilter();
filter.addAction("android.intent.action.SCREEN_OFF");
I noticed one more thing - how I type the filter. nothing is displayed, just the message "No default suggestions"
Can someone help me?
source
share