本文整理汇总了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;
}
});
}
示例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;
}
});
}
示例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;
}
示例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;
}
});
}
示例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;
}
示例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;
}
});
}
示例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;
}
});
}
示例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);
}
示例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;
}
示例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);
}
示例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;
}
});
}
示例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;
}
示例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;
}
示例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() ;
}
示例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());
}
}
});
}