我有一个列表视图,基本上,如果用户尚未单击该位置,我希望Listview
填充并显示“新建”,然后在用户单击该项目后将可见性设置为消失。谁能帮助我?TextView
TextView
Listview
我已经尝试了相当多的一些代码,当然通过反复试验,擦除代码,所以我无法向您展示我尝试过的所有内容。这是我尝试的最后一件事:
// selecting single ListView item
final ListView lv = getListView();
// Launching new screen on Selecting Single ListItem
lv.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view,
int position, long ide) {
if (lv.isPressed(view.hasFocus(position))) {
newjob.setVisibility(View.VISIBLE);
} else {
newjob.setVisibility(View.GONE);
}
vib.vibrate(40);
// Starting new intent
try {
Intent in = new Intent(getApplicationContext(),
SingleMenuItemActivity.class);
in.putExtra("jobInfo", JOBS.getJSONObject(position).toString());
in.putExtra(pays, JOBS.getJSONObject(position).toString());
in.putExtra(job, JOBS.getJSONObject(position).toString());
in.putExtra(ready_at, JOBS.getJSONObject(position).toString());
in.putExtra(due_by, JOBS.getJSONObject(position).toString());
in.putExtra(customer_reference, JOBS.getJSONObject(position).toString());