本文整理匯總了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();
}