Help menus for several screens.

Bug: 5144896
Change-Id: Ib2f5146f6f62f2a33261bb165c3bf1bf13b22f38
This commit is contained in:
Amith Yamasani
2012-04-23 15:35:36 -07:00
parent c1da7b105a
commit b0b37ae21c
13 changed files with 141 additions and 0 deletions

View File

@@ -76,6 +76,7 @@ import android.net.NetworkStats;
import android.net.NetworkStatsHistory;
import android.net.NetworkTemplate;
import android.net.TrafficStats;
import android.net.Uri;
import android.os.AsyncTask;
import android.os.Bundle;
import android.os.INetworkManagementService;
@@ -478,6 +479,18 @@ public class DataUsageSummary extends Fragment {
} else {
metered.setVisible(false);
}
final MenuItem help = menu.findItem(R.id.data_usage_menu_help);
String helpUrl;
if (!TextUtils.isEmpty(helpUrl = getResources().getString(R.string.help_url_data_usage))) {
Intent helpIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(helpUrl));
helpIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK
| Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS);
help.setIntent(helpIntent);
help.setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER);
} else {
help.setVisible(false);
}
}
@Override