当前位置: 首页>>代码示例>>Java>>正文


Java AdapterView类代码示例

本文整理汇总了Java中android.widget.AdapterView的典型用法代码示例。如果您正苦于以下问题:Java AdapterView类的具体用法?Java AdapterView怎么用?Java AdapterView使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


AdapterView类属于android.widget包,在下文中一共展示了AdapterView类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onItemClick

import android.widget.AdapterView; //导入依赖的package包/类
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
	if ("FacebookMessenger".equals(platform.getName())) {
		if(lastPosition >= 0) {
			Following lastFollwing = adapter.getItem(lastPosition);
			lastFollwing.checked = false;
		}
		lastPosition = position;
	}
	Following following = adapter.getItem(position);
	following.checked = !following.checked;

	if(following.checked) {
		checkNum++;
	} else {
		checkNum--;
	}

	updateConfirmView();
	adapter.notifyDataSetChanged();
}
 
开发者ID:Horrarndoo,项目名称:YiZhi,代码行数:21,代码来源:FriendListPage.java

示例2: onItemClick

import android.widget.AdapterView; //导入依赖的package包/类
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
  final String deviceName = ((DeviceListItem)view).getDeviceName();
  final long   deviceId   = ((DeviceListItem)view).getDeviceId();

  AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
  builder.setTitle(getActivity().getString(R.string.DeviceListActivity_unlink_s, deviceName));
  builder.setMessage(R.string.DeviceListActivity_by_unlinking_this_device_it_will_no_longer_be_able_to_send_or_receive);
  builder.setNegativeButton(android.R.string.cancel, null);
  builder.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
    @Override
    public void onClick(DialogInterface dialog, int which) {
      handleDisconnectDevice(deviceId);
    }
  });
  builder.show();
}
 
开发者ID:XecureIT,项目名称:PeSanKita-android,代码行数:18,代码来源:DeviceListFragment.java

示例3: onItemClick

import android.widget.AdapterView; //导入依赖的package包/类
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
    if (currentLevel == LEVEL_PROVINCE) {
        selectedProvince = provinceList.get(position);
        queryCities();
    }
    else if (currentLevel == LEVEL_CITY) {
        selectedCity = cityList.get(position);
        queryCounties();
    }
    else if (currentLevel == LEVEL_COUNTY) {
        String weatherID = countyList.get(position).getWeatherID();
        Intent intent = new Intent(getActivity(), WeatherActivity.class);

        intent.putExtra("weather_id", weatherID);
        startActivity(intent);
        getActivity().finish();
    }
}
 
开发者ID:ValueYouth,项目名称:time-weather,代码行数:20,代码来源:ChooseAreaFragment.java

示例4: onCreate

import android.widget.AdapterView; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    // TODO Auto-generated method stub
    super.onCreate(savedInstanceState);
    this.setContentView(R.layout.label_dialog);
    labelList = (ListView) findViewById(R.id.label_list);
    cancel = (Button) findViewById(R.id.cancel);
    // ListView
    SimpleAdapter adapter = new SimpleAdapter(context, getLabelList(),
            R.layout.label_list_item, new String[]{"label_img",
            "label_value"}, new int[]{
            R.id.label_img, R.id.label_value});
    labelList.setAdapter(adapter);
    //ListView
    labelList
            .setOnItemClickListener(new AdapterView.OnItemClickListener() {
                @Override
                public void onItemClick(AdapterView<?> arg0, View arg1,
                                        int position, long arg3) {
                    HashMap<String, Object> label = getLabelList().get(position);
                    selectedLabel = (String) label.get("label_value");

                    ToodooOptionsModel ToodooOptionsModel = toodooOptionsList.get(0);
                    ToodooOptionsModel.setOptionValue(selectedLabel);
                    mAdapter.notifyDataSetChanged();
                    labelDialog.dismiss();
                }
            });

    cancel.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            labelDialog.dismiss();
        }
    });
}
 
开发者ID:OlayinkaPeter,项目名称:Toodoo,代码行数:37,代码来源:ToodooNote.java

示例5: lvClick

import android.widget.AdapterView; //导入依赖的package包/类
private void lvClick() {

        lv_main.setOnItemClickListener(new AdapterView.OnItemClickListener() {
            @Override
            public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {

                switch (i) {
                    case 0:
                        startOtherActivity(LinearLayoutActivity.class);
                        break;
                    case 1:
                        startOtherActivity(GridActivity.class);
                        break;
                    case 2:
                        startOtherActivity(FlowLayoutActivity.class);
                        break;



                }
            }
        });
    }
 
开发者ID:ruanguihua,项目名称:MultipleRvView,代码行数:24,代码来源:MainActivity.java

示例6: onItemClick

import android.widget.AdapterView; //导入依赖的package包/类
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
	UploadView uploadView = (UploadView)view;
	String uploadId = uploadView.getUploadId();
	if (binder.isStop()) {
		UploadInfo uploadInfo = DataSet.getUploadInfo(uploadId);
		if (uploadInfo != null && uploadInfo.getStatus() != Uploader.FINISH) {
			startUploadService(uploadInfo);
		}
		
		currentUploadId = uploadId;
		
	} else if (uploadId.equals(currentUploadId)) {
		
		switch (binder.getUploaderStatus()) {
		case Uploader.UPLOAD:
			binder.pause();
			break;
		case Uploader.PAUSE:
			binder.upload();
			break;
		}
	}
}
 
开发者ID:lbbniu,项目名称:CCDownload,代码行数:25,代码来源:UploadFragment.java

示例7: onItemClick

import android.widget.AdapterView; //导入依赖的package包/类
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
    ListView listView = (ListView) parent;
    AppInfo appInfo = (AppInfo) listView.getItemAtPosition(position);
    String packageName = appInfo.getPackageName();
    String appName = appInfo.getAppName();
    Log.d(TAG, packageName);
    if(!JniUtil.isRunning(packageName)){
        openApp(packageName);
    }

    Log.d(TAG, "Create folder:" + FileUtil.createPath(HDOG_PATH +File.separator + packageName + File.separator + TYPE_DEX));
    Log.d(TAG, "Create folder:" + FileUtil.createPath(HDOG_PATH +File.separator + packageName + File.separator + TYPE_DEY));

    Intent intent = new Intent(this, DumpActivity.class);
    intent.putExtra("package_name", packageName);
    intent.putExtra("app_name", appName);
    startActivity(intent);
}
 
开发者ID:gnaixx,项目名称:dex-hdog,代码行数:20,代码来源:MainActivity.java

示例8: onItemSelected

import android.widget.AdapterView; //导入依赖的package包/类
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
    if (module == null) return;
    final List<Example> examples = module.getExamples();
    final String category = getCategoryByPosition(selectedPosition);
    final List<Example> exampleItems = convertToAdapterItems(examples, category);
    switch (position) {
        case 0:
            adapter.setSortStrategy(new SortByCategory(exampleItems));
            break;
        case 1:
            adapter.setSortStrategy(new SortByFeatures(exampleItems));
            break;
        case 2:
            adapter.setSortStrategy(new SortByName(exampleItems));
            break;
        case 3:
            adapter.setSortStrategy(new SortByMostUsed(exampleItems));
            break;
    }
}
 
开发者ID:ABTSoftware,项目名称:SciChart.Android.Examples,代码行数:22,代码来源:HomeActivity.java

示例9: onItemLongClick

import android.widget.AdapterView; //导入依赖的package包/类
@Override
public boolean onItemLongClick(AdapterView<?> parent, View view,
        int position, long id) {

    RecentInfo recentInfo = contactAdapter.getItem(position);
    if (recentInfo == null) {
        logger.e("recent#onItemLongClick null recentInfo -> position:%d", position);
        return false;
    }
    if (recentInfo.getSessionType() == DBConstant.SESSION_TYPE_SINGLE) {
        handleContactItemLongClick(getActivity(),recentInfo);
    } else {
        handleGroupItemLongClick(getActivity(),recentInfo);
    }
    return true;
}
 
开发者ID:ccfish86,项目名称:sctalk,代码行数:17,代码来源:ChatFragment.java

示例10: onItemClick

import android.widget.AdapterView; //导入依赖的package包/类
public void onItemClick(AdapterView<?> av, View v, int arg2, long arg3) {
    // Cancel discovery because it's costly and we're about to connect
    mBtAdapter.cancelDiscovery();

    // Get the device MAC address, which is the last 17 chars in the View
    String info = ((TextView) v).getText().toString();
    String address = info.substring(info.length() - 17);

    // Create the result Intent and include the MAC address
    Intent intent = new Intent();
    intent.putExtra(EXTRA_DEVICE_ADDRESS, address);

    // Set result and finish this Activity
    setResult(Activity.RESULT_OK, intent);
    finish();
}
 
开发者ID:sdrausty,项目名称:buildAPKsSamples,代码行数:17,代码来源:DeviceListActivity.java

示例11: onItemClick

import android.widget.AdapterView; //导入依赖的package包/类
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
    switch (position){
        case 1:
            startActivity(new Intent(this, BannerAnimationActivity.class));
            break;
        case 2:
            startActivity(new Intent(this, BannerStyleActivity.class));
            break;
        case 3:
            startActivity(new Intent(this, IndicatorPositionActivity.class));
            break;
        case 4:
            startActivity(new Intent(this, CustomBannerActivity.class));
            break;
        case 5:
            startActivity(new Intent(this, BannerLocalActivity.class));
            break;
        case 6:
            startActivity(new Intent(this, CustomViewPagerActivity.class));
            break;
    }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:24,代码来源:MainActivity.java

示例12: newList

import android.widget.AdapterView; //导入依赖的package包/类
private View newList(
    final PickerQuery q, final ViewAnimator flip,
    AdapterView.OnItemClickListener click) {
  final View list = newList(q, click);
  list.setOnKeyListener(new View.OnKeyListener() {
      @Override
      public boolean onKey(View v, int keyCode, KeyEvent event) {
        if (keyCode == KeyEvent.KEYCODE_BACK &&
            event.getAction() == KeyEvent.ACTION_UP) {
          flip.setInAnimation(getContext(), R.anim.slide_in_left);
          flip.setOutAnimation(getContext(), R.anim.slide_out_right);
          flip.showPrevious();
          flip.removeView(list);
          flip.setInAnimation(getContext(), R.anim.slide_in_right);
          flip.setOutAnimation(getContext(), R.anim.slide_out_left);
          return true;
        }
        return false;
      }
    });
  return list;
}
 
开发者ID:sdrausty,项目名称:buildAPKsApps,代码行数:23,代码来源:MediaPicker.java

示例13: onItemLongClick

import android.widget.AdapterView; //导入依赖的package包/类
@Override
public boolean onItemLongClick(AdapterView<?> parent, View view, int position, long id) {
    listItemList = trollyAdapter.getItems();
    FlipShareView shareBottom = new FlipShareView.Builder(this, mToolbar)
            .addItem(new ShareItem("发布者::"+listItemList.get(position).PublisherName, Color.WHITE, 0xff43549C))
            .addItem(new ShareItem("联系方式:"+listItemList.get(position).PublisherName, Color.WHITE, 0xff43549C))
            .addItem(new ShareItem("物品类型:"+listItemList.get(position).TaskKindID, Color.WHITE, 0xff43549C))
            .addItem(new ShareItem("物品描述:"+listItemList.get(position).Remark, Color.WHITE, 0xff4999F0))
            .addItem(new ShareItem("取件时间:"+listItemList.get(position).FetchTime, Color.WHITE, 0xffD9392D))
            .addItem(new ShareItem("取件地点:"+listItemList.get(position).FetchLocation, Color.WHITE, 0xff57708A))
            .addItem(new ShareItem("送件时间:"+listItemList.get(position).SendTime, Color.WHITE, 0xffea0bb2))
            .addItem(new ShareItem("送件地点:"+listItemList.get(position).SendLocation, Color.WHITE, 0xffea650b))
            .addItem(new ShareItem("订单价格:"+listItemList.get(position).Money, Color.WHITE,0xff063e04))
            .setItemDuration(200)
            .setBackgroundColor(0x60000000)
            .setAnimType(FlipShareView.TYPE_SLIDE)
            .create();
    return true;
}
 
开发者ID:Luodian,项目名称:Shared-Route,代码行数:20,代码来源:TaskViewActivity.java

示例14: initListPop

import android.widget.AdapterView; //导入依赖的package包/类
public void initListPop() {
    listPopupWindow = new ListPopupWindow(getContext());
    ListPopAdapter listPopAdapter = new ListPopAdapter(getContext(), valueList);
    listPopupWindow.setAdapter(listPopAdapter);
    listPopupWindow.setWidth(RelativeLayout.LayoutParams.WRAP_CONTENT);
    listPopupWindow.setHeight(RelativeLayout.LayoutParams.WRAP_CONTENT);
    listPopupWindow.setAnchorView(tv_select_coupons);
    listPopupWindow.setModal(true);
    listPopupWindow.setOnItemClickListener(new AdapterView.OnItemClickListener() {
        @Override
        public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
            tv_select_coupons.setText(valueList.get(position));
            mKey = cardTemplateList.get(position).key;
            listPopupWindow.dismiss();
        }
    });
}
 
开发者ID:fengdongfei,项目名称:CXJPadProject,代码行数:18,代码来源:VoucherFragment.java

示例15: addChangeProfilePicListener

import android.widget.AdapterView; //导入依赖的package包/类
private void addChangeProfilePicListener( final DBHelper dbHelper, final String uid ) {
    gridView.setOnItemClickListener(new OnItemClickListener() {
        @Override
        public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
            pos = position;

            new AlertDialog.Builder(PictureGridActivity.this)
                    .setTitle("Use as profile picture?")
                    .setIcon(android.R.drawable.ic_dialog_alert)
                    .setPositiveButton(android.R.string.yes, new DialogInterface.OnClickListener() {
                        public void onClick(DialogInterface dialog, int whichButton) {
                            StorageReference storageRef = dbHelper.getStorage().getReference("Photo/" + uid + "/" + hashList.get(pos));
                            storageRef.getDownloadUrl().addOnSuccessListener(new OnSuccessListener<Uri>() {
                                @Override
                                public void onSuccess(Uri downloadUrl) {
                                    dbHelper.getDb().getReference(dbHelper.getUserPath()).child(uid).child("profile_pic").setValue(downloadUrl.toString());
                                    finish();
                                }
                            });
                        }
                    })
                    .setNegativeButton(android.R.string.no, null).show();
        }
    });
}
 
开发者ID:chrisqz95,项目名称:couch-potatoes,代码行数:26,代码来源:PictureGridActivity.java


注:本文中的android.widget.AdapterView类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。