在 3 列表视图翻转器中显示不同的字符串数组 Toast
我的 Flipper 上有 3 个列表视图,使用不同的线性布局
ListView list;
ListView list1;
ListView list2;
,并且我有从数组列表转换而来的字符串数组。
ArrayList<String> TextLV1 = new ArrayList<String>();
String[] TextLv1;
我还有一个脚蹼和名为 QuickAction 的弹出菜单按钮
mQuickAction
.setOnActionItemClickListener(new QuickAction.OnActionItemClickListener() {
@Override
public void onItemClick(int pos) {
if (pos == 0) { // Add item selected
Toast.makeText(cobabikinflipper.this,
"Add item selected on row " + mSelectedRow + " " + TextLv[mSelectedRow],
Toast.LENGTH_SHORT).show();
} else if (pos == 1) { // Accept item selected
Toast.makeText(
cobabikinflipper.this,
"Accept item selected on row "
+ mSelectedRow, Toast.LENGTH_SHORT)
.show();
} else if (pos == 2) { // Upload item selected
startActivity(new Intent("com.binus.skripsi.marketdetail"));
} else if (pos == 3) { // Upload item selected
Toast.makeText(
cobabikinflipper.this,
"Lendski items selected on row "
+ mSelectedRow, Toast.LENGTH_SHORT)
.show();
}
}
});
当我单击弹出菜单(pos==0)时,字符串数组是正确的(它显示了正确的字符串),但是当我单击其他时我无法从右侧列表视图更改为正确的字符串。我应该怎么做才能解决这个问题?
当我更改页面时,弹出菜单向我显示正确的字符串,因为我认为 MQuick Action 弹出菜单不适用于 3 列表视图,而是全合一..(抱歉,我的英语不太好)
我认为这是问题 (**) ??
public void onItemClick(int pos) {
if (pos == 0) { // Add item selected
Toast.makeText(cobabikinflipper.this,
"Add item selected on row " + mSelectedRow + " " + **TextLv[mSelectedRow]**,
Toast.LENGTH_SHORT).show();
I have 3 listview on my Flipper using diffrent linear layout
ListView list;
ListView list1;
ListView list2;
and I have String Arrays that has been converted from Array list.
ArrayList<String> TextLV1 = new ArrayList<String>();
String[] TextLv1;
I also have a flipper and pop up menu button called QuickAction in the flipper
mQuickAction
.setOnActionItemClickListener(new QuickAction.OnActionItemClickListener() {
@Override
public void onItemClick(int pos) {
if (pos == 0) { // Add item selected
Toast.makeText(cobabikinflipper.this,
"Add item selected on row " + mSelectedRow + " " + TextLv[mSelectedRow],
Toast.LENGTH_SHORT).show();
} else if (pos == 1) { // Accept item selected
Toast.makeText(
cobabikinflipper.this,
"Accept item selected on row "
+ mSelectedRow, Toast.LENGTH_SHORT)
.show();
} else if (pos == 2) { // Upload item selected
startActivity(new Intent("com.binus.skripsi.marketdetail"));
} else if (pos == 3) { // Upload item selected
Toast.makeText(
cobabikinflipper.this,
"Lendski items selected on row "
+ mSelectedRow, Toast.LENGTH_SHORT)
.show();
}
}
});
When I click on the pop up menu (pos==0) the string array is right(it shows me the right String), But when i click on the others i cant change to the right string from the right listview. what should i do to solve the Condition?
When i Change the page, The pop up menu shows me the right String because i think the MQuick Action Pop up menu works not for 3 listview but All in one.. (Im sorry my english isn't so good)
i think here's the problem (**) ??
public void onItemClick(int pos) {
if (pos == 0) { // Add item selected
Toast.makeText(cobabikinflipper.this,
"Add item selected on row " + mSelectedRow + " " + **TextLv[mSelectedRow]**,
Toast.LENGTH_SHORT).show();
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论