I am using android androids, I am trying to annotate this class in order to save the value in the general preferences class (annotated) using @pref. I managed to find a job with an intention and a broadcast receiver, however this is not ideal, and now when I want to get the value from the general preferences in this class to show how the default element selected in spinner, it starts to smell my code.
Is there a way to annotate this class?
public class SelectNewsFeedDialog extends Dialog { private Context context; private Button confirmButton; private Spinner spinnerTeams; public SelectNewsFeedDialog(final Context context, ArrayList<Team> listTeams) { super(context,R.style.cust_dialog); this.context = context; setContentView(R.layout.dialog_choose_news_feed); spinnerTeams = (Spinner) findViewById(R.id.dialog_news_feed_spinner_teams); confirmButton = (Button) findViewById(R.id.dialog_news_feed_button_confirm); confirmButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Team team = (Team)spinnerTeams.getSelectedItem(); Intent intent = new Intent(context, IntentCenter_.class); intent.putExtra(context.getString(R.string.extra_update_team_news_feed), team.url.toString()); intent.setAction(context.getString(R.string.action_update_team_news_feed)); context.sendBroadcast(intent); dismiss(); } }); SpinnerTeamsAdapter adapter = new SpinnerTeamsAdapter(context, listTeams); spinnerTeams.setAdapter(adapter); } }
android android annotations
Mike bryant
source share