Skip to content

Hide some features to non premium users

Mickael Goubin edited this page Aug 3, 2013 · 1 revision

Once extended AdsFragmentActivity, you can easily use the function isPremium() to check if a user is premium or not. Like that, in your code you can easily check if a user isPremium, and hide or modify some stuff when he is not:

if(!isPremium()) {
	mDrawerList.setOnItemClickListener(new ListView.OnItemClickListener() {
		@Override public void onItemClick(AdapterView parent, View view, int position, long id) {
			showOnlyPremiumDialog(position);
		}
	});
} else {
	mDrawerList.setOnItemClickListener(new ListView.OnItemClickListener() {
		@Override public void onItemClick(AdapterView parent, View view, int position, long id) {
			doStuff(position);
		}
	});
}