當前位置: 首頁>>代碼示例>>Java>>正文


Java OnChildClickListener類代碼示例

本文整理匯總了Java中android.widget.ExpandableListView.OnChildClickListener的典型用法代碼示例。如果您正苦於以下問題:Java OnChildClickListener類的具體用法?Java OnChildClickListener怎麽用?Java OnChildClickListener使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


OnChildClickListener類屬於android.widget.ExpandableListView包,在下文中一共展示了OnChildClickListener類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: initData

import android.widget.ExpandableListView.OnChildClickListener; //導入依賴的package包/類
/**
 * ������չListView׼������,�������
 */
private void initData() {
	CommonnumDao commonnumDao = new CommonnumDao();
	mGroup = commonnumDao.getGroup();
	
	mAdapter = new MyAdapter();
	elv_common_number.setAdapter(mAdapter);
	//������չlistviewע�����¼�
	elv_common_number.setOnChildClickListener(new OnChildClickListener() {
		@Override
		public boolean onChildClick(ExpandableListView parent, View v,
				int groupPosition, int childPosition, long id) {
			//����綽
			startCall(mAdapter.getChild(groupPosition, childPosition).number);
			return false;
		}
	});
}
 
開發者ID:cckevincyh,項目名稱:mobilesafe,代碼行數:21,代碼來源:CommonNumberQueryActivity.java

示例2: setChildListener

import android.widget.ExpandableListView.OnChildClickListener; //導入依賴的package包/類
/**
 * Method for defining the all the listeners on the Home Screen.
 */

private void setChildListener(){
    expListView.setOnChildClickListener(new OnChildClickListener() {
        public boolean onChildClick(ExpandableListView parent, View v,
                                    int groupPosition, int childPosition, long id) {
            final String selected = (String) expListAdapter.getChild(
                    groupPosition, childPosition);
            if (selected.equals("Add New Habit")) {
                //Creating an Intent Bundle to pass over to the Add Medication Screen.
                Intent intent = new Intent(HomeScreen.this, AddMedication.class);
                Bundle extras = new Bundle();
                extras.putString("OPERATION","ADD");
                extras.putInt("ParentPosition", groupPosition);
                intent.putExtras(extras);
                startActivity(intent);
            }
            return true;
        }
    });
}
 
開發者ID:Wahidur-Rahman,項目名稱:Habit-Cookbook,代碼行數:24,代碼來源:HomeScreen.java

示例3: createRecommendBoardView

import android.widget.ExpandableListView.OnChildClickListener; //導入依賴的package包/類
/**
 * 返回推薦版麵
 */
public View createRecommendBoardView() {
	final ExpandableListView recommendBoardList = new ExpandableListView(context);
	recommendBoardList.setDividerHeight(0);
	recommendBoardList.setGroupIndicator(context.getResources().getDrawable(R.drawable.recommend_indicator_selector));
	recommendBoardList.setAdapter(new RecommendBoardListAdapter(getAllBoard()));
	recommendBoardList.setOnChildClickListener(new OnChildClickListener() {

		public boolean onChildClick(ExpandableListView parent, View v, int groupPosition, int childPosition, long id) {				
			BoardObject board = getAllBoard().get(groupPosition).getRecommendBoardList().get(childPosition);
			Intent intent = new Intent(context, DocListActivity.class);
			intent.putExtra("board", board);
			intent.putExtra("action", actionParam);
			context.startActivity(intent);
			return false;
		}
		
	});
	return recommendBoardList;		
}
 
開發者ID:gmud,項目名稱:bbsbrowser_android,代碼行數:23,代碼來源:RecommendBoardView.java

示例4: bindEvents

import android.widget.ExpandableListView.OnChildClickListener; //導入依賴的package包/類
@Override
protected void bindEvents()
{
	expandableListView.setOnChildClickListener(new OnChildClickListener()
	{

		@Override
		public boolean onChildClick(ExpandableListView parent, View v, int groupPosition, int childPosition, long id)
		{
			AlbumInfo albumInfo = (AlbumInfo) parent.getExpandableListAdapter().getChild(groupPosition,
					childPosition);

			Intent intent = new Intent(getContext(), ImageGridActivity.class);
			intent.putExtra(RockyIntent.EXTRA_ALBUM, albumInfo);
			startActivity(intent);

			return false;
		}
	});
}
 
開發者ID:benniaobuguai,項目名稱:android-project-wo2b,代碼行數:21,代碼來源:BlossomHomeFragment.java

示例5: onCreateView

import android.widget.ExpandableListView.OnChildClickListener; //導入依賴的package包/類
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
		Bundle savedInstanceState) {
	View view = inflater.inflate(R.layout.frament_all_list, null);
	
	this.list = (ExpandableListView) view.findViewById(R.id.expandableListView1);
	
	this.list.setOnChildClickListener(new OnChildClickListener() {
		@Override
		public boolean onChildClick(ExpandableListView parent, View v, int groupPosition, int childPosition, long id) {
			ExpandableListAdapter adapter = parent.getExpandableListAdapter();
			MyActivityInfo info = (MyActivityInfo)adapter.getChild(groupPosition, childPosition);
			LauncherIconCreator.launchActivity(getActivity(), info.component_name);
			return false;
		}
	});
	
	AllTasksListAsyncProvider provider = new AllTasksListAsyncProvider(this.getActivity(), this);
	provider.execute();
	
	return view;
}
 
開發者ID:butzist,項目名稱:ActivityLauncher,代碼行數:23,代碼來源:AllTasksListFragment.java

示例6: installListeners

import android.widget.ExpandableListView.OnChildClickListener; //導入依賴的package包/類
@Override
protected void installListeners() {
	// TODO Auto-generated method stub
	mListView.setOnChildClickListener(new OnChildClickListener() {
		@Override
		public boolean onChildClick(ExpandableListView parent, View v,
				int groupPosition, int childPosition, long id) {
			// TODO Auto-generated method stub
			FriendItem item = new FriendItem(groupPosition, childPosition);
			if (mSelectedFriendItems.contains(item)) {
				mSelectedFriendItems.remove(item);
			} else {
				mSelectedFriendItems.add(item);
			}
			mAdapter.notifyDataSetChanged();
			return false;
		}
	});
}
 
開發者ID:ikantech,項目名稱:yiim_v2,代碼行數:20,代碼來源:InviteFriendActivity.java

示例7: onActivityCreated

import android.widget.ExpandableListView.OnChildClickListener; //導入依賴的package包/類
@Override
public void onActivityCreated(Bundle savedInstanceState) {
	super.onActivityCreated(savedInstanceState);
	Context context = getActivity();
	ZenJSONUtil.loadBoardsFromJSON("boards.json");
	mAdapter = new ZenMenuAdapter(context, ZenJSONUtil.headers, ZenJSONUtil.boards);
	mBoards = (ExpandableListView)getView().findViewById(R.id.zen_boards);
	mBoards.setGroupIndicator(null);
	mBoards.setAdapter(mAdapter);
	mBoards.setOnChildClickListener(new OnChildClickListener() {
		
		@Override
		public boolean onChildClick(ExpandableListView parent, View v,
				int groupPosition, int childPosition, long id) {
			
			@SuppressWarnings("unchecked")
			Map<String, String> child = (Map<String, String>)mAdapter.getChild(groupPosition, childPosition);
			Map<String, String> board = child;
			switchContent(board.get("fid"), board.get("name"));
			return false;
		}
	});
}
 
開發者ID:nihaoyalong,項目名稱:zen4android,代碼行數:24,代碼來源:ZenMenuFragment.java

示例8: onPostExecute

import android.widget.ExpandableListView.OnChildClickListener; //導入依賴的package包/類
/** The system calls this to perform work in the UI thread and delivers
  * the result from doInBackground() */
@Override
protected void onPostExecute(final List<ACMDatabaseInfo> result) {
  listAdapter.setListData(result);

  expListView.setOnChildClickListener(new OnChildClickListener() {
    @Override
    public boolean onChildClick(ExpandableListView parent, View v,
        int groupPosition, int childPosition, long id) {

      final ACMDatabaseInfo.DeploymentPackage image = result.get(groupPosition)
          .getDeviceImages().get(childPosition);
      new Thread(new Runnable() {
        @Override public void run() {
          IOHandler.getInstance().store(image);
        }
      }).start();

      return false;
    }

  });

  listAdapter.notifyDataSetChanged();
  progressBar.setVisibility(View.GONE);
}
 
開發者ID:LiteracyBridge,項目名稱:software,代碼行數:28,代碼來源:OnlineFragment.java

示例9: onCreateView

import android.widget.ExpandableListView.OnChildClickListener; //導入依賴的package包/類
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
		Bundle savedInstanceState) {
	View view = inflater.inflate(R.layout.channel_list, container, false);
	
	OnChildClickListener channelItemListener = new OnChildClickListener() {
		@Override
		public boolean onChildClick(ExpandableListView parent, View v,
				int groupPosition, int childPosition, long id) {
			JSONObject channelItem = (JSONObject) adapter.getChild(groupPosition, childPosition);
			channelSelected(channelItem);
			return true;
		}
	};
	
	ExpandableListView channelsView = (ExpandableListView) view.findViewById(R.id.channelListView);
	channelsView.setEmptyView(view.findViewById(R.id.channelListProgress));
	channelsView.setAdapter(adapter);
	channelsView.setOnChildClickListener(channelItemListener);
	
	PauseOnScrollListener listener = new PauseOnScrollListener(ImageLoader.getInstance(), true, true);
	channelsView.setOnScrollListener(listener);
	expandAll(view);
	
	return view;
}
 
開發者ID:buddycloud,項目名稱:buddycloud-android,代碼行數:27,代碼來源:GenericChannelsFragment.java

示例10: initContactView

import android.widget.ExpandableListView.OnChildClickListener; //導入依賴的package包/類
private void initContactView(View view) {
	contactListView = (ExpandableListView) view.findViewById(R.id.friendlist);
	friendAdapter = new ContactAdapter(view.getContext(), contactListView);
	
	//點擊子節點事件
	OnChildClickListener contactListener = new ExpandableListView.OnChildClickListener() {
		@Override
		public boolean onChildClick(ExpandableListView parent, View v, int groupPosition, int childPosition, long id) {
			Object obj = friendAdapter.getChild(groupPosition, childPosition);
			if (obj instanceof ContactInfo) {
				ContactInfo mi = (ContactInfo) obj;
				Intent intent = new Intent(activity, ChatActivity.class);
				intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK
						| Intent.FLAG_ACTIVITY_SINGLE_TOP
						| Intent.FLAG_ACTIVITY_CLEAR_TOP);
				String name = null;
				if (StringUtils.isNotBlank(mi.getName())) {
					name = mi.getName();
				} else {
					name = mi.getContact();
				}
				intent.putExtra(ChatActivity.INTENT_TITLE, name);
				intent.putExtra(ChatActivity.INTENT_TOID, mi.getCon_uid());
				startActivity(intent);
			}
			return true;
		}
	};
	contactListView.setAdapter(friendAdapter);
	contactListView.setOnChildClickListener(contactListener);
}
 
開發者ID:entboost,項目名稱:EntboostIM,代碼行數:32,代碼來源:FriendMainFragment.java

示例11: onActivityCreated

import android.widget.ExpandableListView.OnChildClickListener; //導入依賴的package包/類
public void onActivityCreated(Bundle savedInstanceState) {
	super.onActivityCreated(savedInstanceState);

	final Calendar c = Calendar.getInstance();// 獲取當前係統日期
	defaultYear = c.get(Calendar.YEAR);// 獲取年份
	defaultMonth = c.get(Calendar.MONTH) + 1;// 獲取月份

	findViews();

	initData(0);

	elv.setOnChildClickListener(new OnChildClickListener() {
		@Override
		public boolean onChildClick(ExpandableListView parent, View view,
				int groupPosition, int childPosition, long id) {
			TextView txno = (TextView) view.findViewById(R.id.no);
			TextView txkind = (TextView) view.findViewById(R.id.kind);
			String strtype = ((String) txkind.getText()).substring(1,
					((String) txkind.getText()).indexOf(']')).trim();// 從收入信息中截取收支類型
			String strno = (String) txno.getText(); // 從信息中截取收支編號
			Intent intent = new Intent(getActivity(), AddPay.class);// 創建Intent對象
			if (strtype.equals("收入")) {
				intent.putExtra("cwp.message", new String[] { strno,
						"btnininfo" });// 設置傳遞數據
			}
			if (strtype.equals("支出")) {
				intent.putExtra("cwp.message", new String[] { strno,
						"btnoutinfo" });// 設置傳遞數據
			}
			intent.putExtra("cwp.id", userid);
			intent.putExtra("cwp.frament3", "3");
			startActivity(intent);// 執行Intent操作
			return false;
		}

	});
}
 
開發者ID:linmp4,項目名稱:quickmark,代碼行數:38,代碼來源:FragmentPage3.java

示例12: onCreateView

import android.widget.ExpandableListView.OnChildClickListener; //導入依賴的package包/類
public View onCreateView(LayoutInflater inflater, ViewGroup container,
		Bundle savedInstanceState) { 
	 mActivity = (ContacterActivity)this.getActivity();
	 application = (MyApplication) mActivity.getApplication();
	 
	 View view = inflater.inflate(R.layout.im_contact_list, null);
	 mListView = (ExpandableListView) view.findViewById(R.id.contact_list);
	 
	 mGroupNames = new ArrayList<String>();
	 mIMRosterGroups = new ArrayList<IMRosterGroup>();
	 
	 mContacterListAdapter = new ContacterExpandableListAdapter(mActivity, mIMRosterGroups);
	 mListView.setAdapter(mContacterListAdapter);
		
	 mListView.setOnChildClickListener(new OnChildClickListener() {

			public boolean onChildClick(ExpandableListView parent, View v,
					int groupPosition, int childPosition, long id) {
				IMRosterGroup  mIMRosterGroup  = mIMRosterGroups.get(groupPosition);
				List<IMUser> mUsers = mIMRosterGroup.getUsers();
				IMUser user = mUsers.get(childPosition);
				toChat(user.getName());
				return true;
			}
	});
	 
	initContacter();
	 
	return view;
}
 
開發者ID:jingshauizh,項目名稱:androidsummary,代碼行數:31,代碼來源:ContacterFragment.java

示例13: onCreateView

import android.widget.ExpandableListView.OnChildClickListener; //導入依賴的package包/類
@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) {
		super.onCreateView(inflater, container, savedInstanceState);
		
		View v = inflater.inflate(R.layout.fragment_armor_expandablelist, null);
//		setContextMenu(v);
		
		elv = (ExpandableListView) v
				.findViewById(R.id.expandableListView);

		elv.setAdapter(new ArmorListAdapter(slots));
		
		elv.setOnChildClickListener(new OnChildClickListener() {

			@Override
			public boolean onChildClick(ExpandableListView arg0, View arg1,
					int arg2, int arg3, long id) {
				
				Intent i = new Intent(getActivity(), ArmorDetailActivity.class);
				i.putExtra(ArmorDetailActivity.EXTRA_ARMOR_ID, (long) arg1.getTag());
				startActivity(i);

				return false;
			}
		});
		
		return v;
	}
 
開發者ID:dbooga,項目名稱:MonsterHunter3UDatabase,代碼行數:30,代碼來源:ArmorExpandableListFragment.java

示例14: onCreate

import android.widget.ExpandableListView.OnChildClickListener; //導入依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
	// TODO Auto-generated method stub
	super.onCreate(savedInstanceState);
	setContentView(R.layout.activity_clustersahara);
	
	ExpandableListView elv = (ExpandableListView) findViewById(R.id.cluster_elv) ;
	elAdapter = new ExpandListAdapter(getApplicationContext(), arr_cluster, arr_node) ;
	elv.setAdapter(elAdapter) ;
	elv.setOnChildClickListener(new OnChildClickListener() {
		
		@Override
		public boolean onChildClick(ExpandableListView arg0, View arg1, int arg2,
				int arg3, long arg4) {
			// TODO Auto-generated method stub
			if(arr_cluster.get(arg2).isActive()) {
				if(arr_node.get(arg2).get(arg3).isMaster()) {
					Conf.address_node = arr_node.get(arg2).get(arg3).getIp() ;
					Intent it = new Intent(getApplicationContext(), MainActivity.class) ;
					startActivity(it) ;
				} else 
					Toast.makeText(getApplicationContext(), "Please choose Master node !", Toast.LENGTH_SHORT).show();
			} else 
				Toast.makeText(getApplicationContext(), "Cluster is not active !", Toast.LENGTH_SHORT).show();
			return false;
		}
	}) ;
	
	new loadClustersSahara().execute() ;
}
 
開發者ID:datts68,項目名稱:maas,代碼行數:31,代碼來源:ClusterSaharaActivity.java

示例15: onActivityCreated

import android.widget.ExpandableListView.OnChildClickListener; //導入依賴的package包/類
public void onActivityCreated (Bundle savedInstanceState) {
 	super.onActivityCreated(savedInstanceState);
     
   	mAdapter = new AllRoutesAdapter(getActivity(), mImageFetcher, getListHeaders());      	 
     
     mList.setAdapter(mAdapter);
     mList.setFastScrollEnabled(true);
     mList.setOnChildClickListener(new OnChildClickListener() {

@Override
public boolean onChildClick(ExpandableListView parent, View v,
		int groupPosition, int childPosition, long id) {
	RowItem rowItem = (RowItem) mAdapter.getChild(groupPosition, childPosition);
	
 			Intent intent = new Intent(AllRoutesFragment.this.getActivity(), PointOfInterestDetailActivity.class);
 			intent.putExtra(Constants.INTENT_TITLE, rowItem.getTitle());
 			intent.putExtra(Constants.INTENT_RES_ID, rowItem.getResId());
 			intent.putExtra(Constants.INTENT_DRAWER_POSITION, 1);
 			AllRoutesFragment.this.startActivity(intent);
	return false;
}
     	
     });
     
     ViewTreeObserver vto = mList.getViewTreeObserver();
     vto.addOnGlobalLayoutListener(new OnGlobalLayoutListener() {
     	@SuppressLint("NewApi")
     	@Override
     	public void onGlobalLayout() {
     		if (android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.JELLY_BEAN_MR2) {
     			mList.setIndicatorBounds(mList.getRight()- 70, mList.getWidth());
     		} else {
     			mList.setIndicatorBoundsRelative(mList.getRight()- 70, mList.getWidth());
     		}
     	}
     });
 }
 
開發者ID:iiseagrant,項目名稱:ChicagoWaterWalk-Android,代碼行數:38,代碼來源:AllRoutesFragment.java


注:本文中的android.widget.ExpandableListView.OnChildClickListener類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。