本文整理汇总了Java中android.content.Intent.getIntegerArrayListExtra方法的典型用法代码示例。如果您正苦于以下问题:Java Intent.getIntegerArrayListExtra方法的具体用法?Java Intent.getIntegerArrayListExtra怎么用?Java Intent.getIntegerArrayListExtra使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.content.Intent
的用法示例。
在下文中一共展示了Intent.getIntegerArrayListExtra方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: init
import android.content.Intent; //导入方法依赖的package包/类
private void init() {
llTopMenuWindowBg = findViewById(R.id.llTopMenuWindowBg);
llTopMenuWindowBg.setOnClickListener(this);
Intent intent = getIntent();
int[] intentCodes = intent.getIntArrayExtra(INTENT_INTENTCODES);
if (intentCodes == null || intentCodes.length <= 0) {
intentCodeList = intent.getIntegerArrayListExtra(INTENT_INTENTCODES);
} else {
intentCodeList = new ArrayList<Integer>();
for (int code : intentCodes) {
intentCodeList.add(code);
}
}
String[] menuItems = intent.getStringArrayExtra(INTENT_NAMES);
if (menuItems == null || menuItems.length <= 0) {
nameList = intent.getStringArrayListExtra(INTENT_NAMES);
} else {
nameList = new ArrayList<String>(Arrays.asList(menuItems));
}
if (nameList == null || nameList.size() <= 0) {
Log.e(TAG, "init nameList == null || nameList.size() <= 0 >> finish();return;");
finish();
return;
}
adapter = new ArrayAdapter<String>(this, R.layout.top_menu_list_item, R.id.tvTopMenuListItem, nameList);
lvTopMenu = (ListView) findViewById(R.id.lvTopMenuWindowMenu);
lvTopMenu.setAdapter(adapter);
lvTopMenu.setOnItemClickListener(this);
}
示例2: onCreate
import android.content.Intent; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_results);
Intent intent = getIntent();
playerNames = intent.getStringArrayListExtra("player_names");
playerScores = intent.getIntegerArrayListExtra("player_scores");
generateLeaderBoard();
}