android.widget.AdapterView.OnItemClickListener Java Examples

The following examples show how to use android.widget.AdapterView.OnItemClickListener. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: FoldingActivitys.java    From UltimateAndroid with Apache License 2.0 6 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.folding_drawer_activity);

    ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,
            android.R.layout.simple_list_item_1, testValues);
    listView = (ListView) findViewById(R.id.foldingDrawerListView1);
    listView.setAdapter(adapter);
    listView.setOnItemClickListener(new OnItemClickListener() {

        @Override
        public void onItemClick(AdapterView<?> arg0, View arg1, int arg2,
                                long arg3) {
            Intent intent = new Intent();
            intent.setClassName(FoldingActivitys.this, "com.marshalchen.common.demoofui.foldingDrawer." + testValues[arg2]
                    + "Activity");

            startActivity(intent);

        }
    });

}
 
Example #2
Source File: AppVu.java    From FlyWoo with Apache License 2.0 6 votes vote down vote up
public void setOnItemClickListener() {
    gridView.setOnItemClickListener(new OnItemClickListener() {
        @Override
        public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
            AppItemVu vu = (AppItemVu) view.getTag();
            boolean isChecked = vu.toggleChecked();
            if(isChecked){
                //添加一个文件
                sendFileListener.addSendFile(list.get(position));
            }else{
                //移除一个文件
                sendFileListener.removeSendFile(list.get(position));
            }
            adapter.notifyDataSetChanged();
        }
    });
}
 
Example #3
Source File: BirdGridFragment.java    From Moring-Alarm with Apache License 2.0 6 votes vote down vote up
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
	if (mPos == -1 && savedInstanceState != null)
		mPos = savedInstanceState.getInt("mPos");
	TypedArray imgs = getResources().obtainTypedArray(R.array.birds_img);
	mImgRes = imgs.getResourceId(mPos, -1);
	
	GridView gv = (GridView) inflater.inflate(R.layout.list_grid, null);
	gv.setBackgroundResource(android.R.color.black);
	gv.setAdapter(new GridAdapter());
	gv.setOnItemClickListener(new OnItemClickListener() {
		@Override
		public void onItemClick(AdapterView<?> parent, View view, int position,
				long id) {
			if (getActivity() == null)
				return;
			ResponsiveUIActivity activity = (ResponsiveUIActivity) getActivity();
			activity.onBirdPressed(mPos);
		}			
	});
	return gv;
}
 
Example #4
Source File: YayaEmoGridView.java    From sctalk with Apache License 2.0 6 votes vote down vote up
private GridView getViewPagerItem(final int index) {
    GridView gridView = new GridView(_context);
    gridView.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT,
            LayoutParams.WRAP_CONTENT));
    gridView.setNumColumns(4);
    gridView.setVerticalScrollBarEnabled(false);
    gridView.setHorizontalScrollBarEnabled(false);
    gridView.setPadding(8, 8, 8, 0);
    gridView.setVerticalSpacing(20);
    gridView.setSelector(new ColorDrawable(Color.TRANSPARENT));

    gridView.setAdapter(new YayaEmoGridViewAdapter(_context,
            getGridViewData(index)));
    gridView.setOnItemClickListener(new OnItemClickListener() {
        @Override
        public void onItemClick(AdapterView<?> parent, View view,
                int position, long id) {
            int start = index * SysConstant.yayaPageSize;
            onEmoGridViewItemClick.onItemClick(position + start, index);
        }
    });
    return gridView;
}
 
Example #5
Source File: UnidentifiedMovies.java    From Mizuu with Apache License 2.0 6 votes vote down vote up
@Override
public void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);

	mList = (ListView) findViewById(R.id.listView1);
	mList.setChoiceMode(ListView.CHOICE_MODE_NONE);
	mList.setOnItemClickListener(new OnItemClickListener() {
		@Override
		public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {
			Intent intent = new Intent(UnidentifiedMovies.this, IdentifyMovie.class);
			intent.putExtra("fileName", mFilepaths.get(arg2).getFullFilepath());
			startActivityForResult(intent, 0);
		}
	});

	loadData();

	LocalBroadcastManager.getInstance(this).registerReceiver(mMessageReceiver, new IntentFilter(LocalBroadcastUtils.UPDATE_MOVIE_LIBRARY));
}
 
Example #6
Source File: ListBtYearViewProvider.java    From BonetCalendarView with Apache License 2.0 6 votes vote down vote up
@Override
public View getView() {
	mListView = (ListView) LayoutInflater.from(getCalendar().getContext()).inflate(R.layout.month_list_view, null);
	mListView.setOnItemClickListener(new OnItemClickListener() {

		@Override
		public void onItemClick(AdapterView<?> arg0, View arg1, int position,long arg3) {
			if(! (getCalendar() ==null))
				getCalendar().notifyMonthChanged(new BtMonth(getYear(),position));
		}
	
	});

	mAdapter = new MonthListAdapter(getCalendar(),getYear());
	
	mListView.setAdapter(mAdapter);
	
	return mListView;
}
 
Example #7
Source File: RecipientEditTextView.java    From talk-android with MIT License 6 votes vote down vote up
private void showAddress(final DrawableRecipientChip currentChip, final ListPopupWindow popup,
                         int width) {
    if (!mAttachedToWindow) {
        return;
    }
    int line = getLayout().getLineForOffset(getChipStart(currentChip));
    int bottom = calculateOffsetFromBottom(line);
    // Align the alternates popup with the left side of the View,
    // regardless of the position of the chip tapped.
    popup.setWidth(width);
    popup.setAnchorView(this);
    popup.setVerticalOffset(bottom);
    popup.setAdapter(createSingleAddressAdapter(currentChip));
    popup.setOnItemClickListener(new OnItemClickListener() {
        @Override
        public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
            unselectChip(currentChip);
            popup.dismiss();
        }
    });
    popup.show();
    ListView listView = popup.getListView();
    listView.setChoiceMode(ListView.CHOICE_MODE_SINGLE);
    listView.setItemChecked(0, true);
}
 
Example #8
Source File: SimpleDevicePicker.java    From Connect-SDK-Android-Core with Apache License 2.0 6 votes vote down vote up
public void showPicker() {
    cleanupPending(); // remove any currently pending device
    hidePicker();

    pickerDialog = picker.getPickerDialog(activity.getString(selectDeviceResId), new OnItemClickListener() {
        @Override
        public void onItemClick(AdapterView<?> adapter, View view, int pos,
                long id) {
            ConnectableDevice device = (ConnectableDevice) adapter.getItemAtPosition(pos);

            selectDevice(device);
        }
    });

    pickerDialog.show();
}
 
Example #9
Source File: ListViewActivity.java    From coursera-android with MIT License 6 votes vote down vote up
@Override
public void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);

	// Create a new Adapter containing a list of colors
	// Set the adapter on this ListActivity's built-in ListView
	setListAdapter(new ArrayAdapter<String>(this, R.layout.list_item,
			getResources().getStringArray(R.array.colors)));

	ListView lv = getListView();

	// Enable filtering when the user types in the virtual keyboard
	lv.setTextFilterEnabled(true);

	// Set an setOnItemClickListener on the ListView
	lv.setOnItemClickListener(new OnItemClickListener() {
		public void onItemClick(AdapterView<?> parent, View view,
				int position, long id) {

			// Display a Toast message indicting the selected item
			Toast.makeText(getApplicationContext(),
					((TextView) view).getText(), Toast.LENGTH_SHORT).show();
		}
	});
}
 
Example #10
Source File: BirdGridFragment.java    From Moring-Alarm with Apache License 2.0 6 votes vote down vote up
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
	if (mPos == -1 && savedInstanceState != null)
		mPos = savedInstanceState.getInt("mPos");
	TypedArray imgs = getResources().obtainTypedArray(R.array.birds_img);
	mImgRes = imgs.getResourceId(mPos, -1);
	
	GridView gv = (GridView) inflater.inflate(R.layout.list_grid, null);
	gv.setBackgroundResource(android.R.color.black);
	gv.setAdapter(new GridAdapter());
	gv.setOnItemClickListener(new OnItemClickListener() {
		@Override
		public void onItemClick(AdapterView<?> parent, View view, int position,
				long id) {
			if (getActivity() == null)
				return;
			ResponsiveUIActivity activity = (ResponsiveUIActivity) getActivity();
			activity.onBirdPressed(mPos);
		}			
	});
	return gv;
}
 
Example #11
Source File: ListImageDirPopupWindow.java    From base-imageloader with Apache License 2.0 6 votes vote down vote up
@Override
public void initEvents()
{
	mListDir.setOnItemClickListener(new OnItemClickListener()
	{
		@Override
		public void onItemClick(AdapterView<?> parent, View view,
				int position, long id)
		{

			if (mImageDirSelected != null)
			{
				mImageDirSelected.selected(mDatas.get(position));
			}
		}
	});
}
 
Example #12
Source File: EmojiPageFragment.java    From KJFrameForAndroid with Apache License 2.0 6 votes vote down vote up
@Override
public View onCreateView(LayoutInflater inflater,
        @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
    super.onCreateView(inflater, container, savedInstanceState);
    sGrid = new GridView(getActivity());
    sGrid.setNumColumns(KJEmojiConfig.COLUMNS);
    adapter = new EmojiGridAdapter(getActivity(), datas);
    sGrid.setAdapter(adapter);
    sGrid.setOnItemClickListener(new OnItemClickListener() {
        @Override
        public void onItemClick(AdapterView<?> parent, View view,
                int position, long id) {
            EditText editText = (EditText) getActivity().findViewById(
                    R.id.emoji_titile_input);
            if (position + 1 != datas.size()) {
                InputHelper.input(editText, (Emojicon) parent.getAdapter()
                        .getItem(position));
            } else {
                InputHelper.backspace(editText);
            }
        }
    });
    sGrid.setSelector(new ColorDrawable(Color.TRANSPARENT));
    return sGrid;
}
 
Example #13
Source File: AlbumActivity.java    From socialauth-android with MIT License 6 votes vote down vote up
public void getData(final List<Album> albumList) {
	final GridView view = new GridView(this);
	getGridProperties(view);

	view.setAdapter(new AlbumsAdapter(AlbumActivity.this, 0, albumList));

	String[] urls = new String[albumList.size()];
	for (int i = 0; i < albumList.size(); i++) {
		urls[i] = albumList.get(i).getCoverPhoto();
	}

	view.setOnItemClickListener(new OnItemClickListener() {
		@Override
		public void onItemClick(AdapterView<?> parent, View v, int position, long id) {
			showPhoto(view, albumList, position);
			photoListFlag = true;
		}
	});
	dataSectionView.addView(view);
}
 
Example #14
Source File: AlertBuilder.java    From biermacht with Apache License 2.0 6 votes vote down vote up
public <T> AlertDialog.Builder searchableListAlert(final TextView text, final TextView title, final ArrayAdapter<T> adapter,
                                                   final ArrayList<T> list, final OnItemClickListener listener, TextWatcher textWatcher) {
  LayoutInflater factory = LayoutInflater.from(context);
  final LinearLayout alertView = (LinearLayout) factory.inflate(R.layout.alert_view_searchable_list, null);
  final EditText editText = (EditText) alertView.findViewById(R.id.edit_text);
  final ListView listView = (ListView) alertView.findViewById(R.id.list);
  listView.setOnItemClickListener(listener);
  listView.setAdapter(adapter);

  // Search text watcher.
  editText.addTextChangedListener(textWatcher);
  textWatcher.onTextChanged("", 0, 0, 0);

  return new AlertDialog.Builder(context)
          .setTitle(title.getText().toString())
          .setView(alertView)
          .setNegativeButton(R.string.cancel, null);
}
 
Example #15
Source File: CaldroidFragment.java    From iSCAU-Android with GNU General Public License v3.0 6 votes vote down vote up
/**
 * Callback to listener when date is valid (not disable, not outside of
 * min/max date)
 * 
 * @return
 */
private OnItemClickListener getDateItemClickListener() {
	dateItemClickListener = new OnItemClickListener() {
		@Override
		public void onItemClick(AdapterView<?> parent, View view,
				int position, long id) {

			DateTime dateTime = dateInMonthsList.get(position);

			if (caldroidListener != null) {
				if ((minDateTime != null && dateTime.lt(minDateTime))
						|| (maxDateTime != null && dateTime.gt(maxDateTime))
						|| (disableDates != null && disableDates
								.indexOf(dateTime) != -1)) {
					return;
				}

				Date date = CalendarHelper.convertDateTimeToDate(dateTime);
				caldroidListener.onSelectDate(date, view);
			}
		}
	};

	return dateItemClickListener;
}
 
Example #16
Source File: ListTemplateView.java    From BotLibre with Eclipse Public License 1.0 5 votes vote down vote up
@SuppressWarnings("unchecked")
@Override
protected void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);
	setContentView(R.layout.activity_list_view);
	

	llview = (ListView) findViewById(R.id.theListView);
	txt=(TextView) findViewById(R.id.theTitle);
	txt.setText("Select Template");

	adapter = new ImageListAdapter(this,
               R.layout.image_list, (List) MainActivity.getAllTemplates(this));
	llview.setAdapter(adapter);
	
	llview.setOnItemClickListener(new OnItemClickListener() {
		@Override
		public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {
			
			InstanceConfig templates = (InstanceConfig) (llview.getItemAtPosition(arg2));
			Toast.makeText(ListTemplateView.this, templates.name + " Selected", Toast.LENGTH_SHORT).show();
			data.putExtra("template", templates.name);
			setResult(RESULT_OK,data);
			finish();
		}
	});
	
	HttpAction action = new HttpGetTemplatesAction(this);
   	action.execute();
	
}
 
Example #17
Source File: ChatActivity.java    From Conquer with Apache License 2.0 5 votes vote down vote up
private View getGridView(final int i) {
	View view = View.inflate(this, R.layout.include_emo_gridview, null);
	GridView gridview = (GridView) view.findViewById(R.id.gridview);
	List<FaceText> list = new ArrayList<FaceText>();
	if (i == 0) {
		list.addAll(emos.subList(0, 21));
	} else if (i == 1) {
		list.addAll(emos.subList(21, emos.size()));
	}
	final EmoteAdapter gridAdapter = new EmoteAdapter(ChatActivity.this, list);
	gridview.setAdapter(gridAdapter);
	gridview.setOnItemClickListener(new OnItemClickListener() {

		@Override
		public void onItemClick(AdapterView<?> arg0, View arg1, int position, long arg3) {
			FaceText name = (FaceText) gridAdapter.getItem(position);
			String key = name.text.toString();
			try {
				if (edit_user_comment != null && !TextUtils.isEmpty(key)) {
					int start = edit_user_comment.getSelectionStart();
					CharSequence content = edit_user_comment.getText().insert(start, key);
					edit_user_comment.setText(content);
					// 定位光标位置
					CharSequence info = edit_user_comment.getText();
					if (info instanceof Spannable) {
						Spannable spanText = (Spannable) info;
						Selection.setSelection(spanText, start + key.length());
					}
				}
			} catch (Exception e) {

			}

		}
	});
	return view;
}
 
Example #18
Source File: Rank.java    From AndroidLinkup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * 设置关卡选择的监听器
 * 
 * @param levelListener
 *            选择关卡操作接口
 */
public void setLevelLister(final ISelectedLevel levelListener) {
    holder.rankGrid.setOnItemClickListener(new OnItemClickListener() {
        @Override
        public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {
            if (levelListener != null) {
                levelListener.onSelectedLevel(rankCfg.getLevelInfos().get(arg2));
            }
        }
    });
}
 
Example #19
Source File: Phone_frag.java    From ui with Apache License 2.0 5 votes vote down vote up
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
		Bundle savedInstanceState) {
	View myView = inflater.inflate(R.layout.phone_frag, container, false);

       ListView list = (ListView) myView.findViewById(R.id.ListView01);
       list.setClickable(true);

       final List<Phonebook> listOfPhonebook = new ArrayList<Phonebook>();
       listOfPhonebook.add(new Phonebook("Test", "9981728", "[email protected]"));
       listOfPhonebook.add(new Phonebook("Test1", "1234455", "[email protected]"));
       listOfPhonebook.add(new Phonebook("Test2", "00000", "[email protected]"));
       listOfPhonebook.add(new Phonebook("Test3", "00000", "[email protected]"));
       listOfPhonebook.add(new Phonebook("Test4", "00000", "test4test.com"));
       listOfPhonebook.add(new Phonebook("Test5", "00000", "[email protected]"));
       listOfPhonebook.add(new Phonebook("Test6", "00000", "[email protected]"));

       PhonebookAdapter adapter = new PhonebookAdapter(myContext, listOfPhonebook);

       list.setOnItemClickListener(new OnItemClickListener() {

           @Override
           public void onItemClick(AdapterView<?> arg0, View view, int position, long index) {
               showToast(listOfPhonebook.get(position).getName());
           }
       });

       list.setAdapter(adapter);
       
       return myView;
   }
 
Example #20
Source File: BottomSheet.java    From AndroidBottomSheet with Apache License 2.0 5 votes vote down vote up
/**
 * Creates and returns a listener, which allows to observe when the items of a bottom sheet have
 * been clicked.
 *
 * @return The listener, which has been created, as an instance of the type {@link
 * OnItemClickListener}
 */
private OnItemClickListener createItemClickListener() {
    return new OnItemClickListener() {

        @Override
        public void onItemClick(final AdapterView<?> parent, final View view,
                                final int position, final long id) {
            if (itemClickListener != null && !rootView.isDragging() &&
                    !rootView.isAnimationRunning()) {
                int index = position;

                if (adapter.containsDividers()) {
                    for (int i = position; i >= 0; i--) {
                        if (adapter.getItem(i) == null ||
                                (adapter.getItem(i) instanceof Divider &&
                                        i % adapter.getColumnCount() > 0)) {
                            index--;
                        }
                    }
                }

                itemClickListener.onItemClick(parent, view, index, getId(position));
            }

            dismiss();
        }

    };
}
 
Example #21
Source File: AppListActivity.java    From Android-PreferencesManager with Apache License 2.0 5 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    setTheme(App.theme.theme);
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_app_list);
    Utils.checkBackups(getApplicationContext());
    ActionBar actionBar = getActionBar();
    if (actionBar != null) {
        actionBar.setTitle(Ui.applyCustomTypeFace(getString(R.string.app_name), this));
    }

    loadingView = findViewById(R.id.loadingView);
    emptyView = findViewById(R.id.emptyView);
    listView = (StickyListHeadersListView) findViewById(R.id.listView);
    listView.setDrawingListUnderStickyHeader(false);
    listView.setOnItemClickListener(new OnItemClickListener() {
        @Override
        public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {
            if (isRootAccessGiven) {
                startPreferencesActivity((AppEntry) mAdapter.getItem(arg2));
            } else {
                checkRoot();
            }
        }
    });

    if (savedInstanceState == null) {
        checkRoot();
    }

    if (savedInstanceState == null || Utils.getPreviousApps() == null) {
        startTask();
    } else {
        updateListView(Utils.getPreviousApps());
    }
}
 
Example #22
Source File: OutlineAdapter.java    From document-viewer with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void onClick(final View v) {
    for (ViewParent p = v.getParent(); p != null; p = p.getParent()) {
        if (p instanceof ListView) {
            final ListView list = (ListView) p;
            final OnItemClickListener l = list.getOnItemClickListener();
            if (l != null) {
                l.onItemClick(list, v, ((Integer) v.getTag()).intValue(), 0);
            }
            return;
        }
    }

}
 
Example #23
Source File: GridFragment.java    From coursera-android with MIT License 5 votes vote down vote up
@Override
public void onActivityCreated(Bundle savedInstanceState) {
	super.onActivityCreated(savedInstanceState);
	
	mGridview.setAdapter(new ImageAdapter(getActivity(), mThumbNailIDs));
	mGridview.setOnItemClickListener(new OnItemClickListener() {
		public void onItemClick(AdapterView<?> parent, View v,
				int position, long id) {
			Intent intent = new Intent(getActivity(),
					ImageViewActivity.class);
			intent.putExtra(EXTRA_RES_ID, (int) id);
			startActivity(intent);
		}
	});
}
 
Example #24
Source File: GridBtMonthViewProvider.java    From BonetCalendarView with Apache License 2.0 5 votes vote down vote up
public GridBtMonthViewProvider(Context context, BtMonth month) {
	super(month);
	
	mContext = context;
	
	Log.d("", "Criando DayGridAdapter");
	mAdapter = new DayGridAdapter(context,month,getMinDate(),getMaxDate());

	mMonthDisplay = new MonthDisplayHelper(month.getYear(), month.getMonth());

	mGridItemClickedListener = new OnItemClickListener() {
		
		@Override
		public void onItemClick(AdapterView<?> adapter, View arg1, int position,
				long arg3) {
			
			int fp = mMonthDisplay.getRowOf(1)*7+mMonthDisplay.getColumnOf(1);
			int lp = fp+ mMonthDisplay.getNumberOfDaysInMonth();
			
			// Checks to see if the position selected represents a date within the month
			if(position >= fp && position <lp) {
			
				BtDate day;
				// Checks to see if the selected date is within the defined bounds
				if( (day = getMonth().getDate(position+1-fp)).isWithinBounds(getMinDate(),getMaxDate()))
					selectDay(day);
				
			}
		}
	};
	
}
 
Example #25
Source File: BrowseGraphicActivity.java    From BotLibre with Eclipse Public License 1.0 5 votes vote down vote up
@Override
public void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);
	Bundle bundle = getIntent().getExtras();
	try{
   	CustomAvatar = bundle.getBoolean("dataCustomAvatar");
	}catch(Exception e){MainActivity.showMessage(e.getMessage(), this);}
   	if(CustomAvatar){
   	
   		titleName = bundle.getString("dataName");
   		TextView title = (TextView) findViewById(R.id.title);
   		title.setText(titleName);
   		findViewById(R.id.menuButton).setVisibility(View.GONE);
   		findViewById(R.id.searchButton).setVisibility(View.GONE);
   		final ListView llview = (ListView) findViewById(R.id.instancesList);
   		llview.setOnItemClickListener(new OnItemClickListener() {

   			@Override
   			public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {
   				//Getting Info from the main class of the categories.EX name, icon, ...etc
   				select(arg1);
   				setResult(RESULT_OK,data);
   			}
   		});
   	}
   	
}
 
Example #26
Source File: ActorTaggedPhotosFragment.java    From Mizuu with Apache License 2.0 5 votes vote down vote up
public void onViewCreated(View v, Bundle savedInstanceState) {
	super.onViewCreated(v, savedInstanceState);

	mProgressBar = (ProgressBar) v.findViewById(R.id.progress);
	mGridView = (GridView) v.findViewById(R.id.gridView);

	mGridView.setOnItemClickListener(new OnItemClickListener() {
		@Override
		public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {
			startActivity(IntentUtils.getActorTaggedPhotoIntent(mContext, mActor.getTaggedPhotos(), arg2));
		}
	});

	new TaggedPhotoLoader(mContext, mActorId).execute();
}
 
Example #27
Source File: ImageFileActivity.java    From school_shop with MIT License 5 votes vote down vote up
private void initView() {
	gridView = (GridView)findViewById(R.id.imageFile_act_fileGridView);
	
	initToolbar(getResources().getString(R.string.title_activity_picture_file));
	helper = AlbumHelper.getHelper();
	helper.init(getApplicationContext());
	contentList = helper.getImagesBucketList(false);
	folderAdapter = new FolderAdapter(this,contentList);
	gridView.setAdapter(folderAdapter);
	dataList = new ArrayList<ImageItem>();
	for(int i = 0; i<contentList.size();i++){
		dataList.addAll(contentList.get(i).imageList);
	}
	
	gridView.setOnItemClickListener(new OnItemClickListener() {

		@Override
		public void onItemClick(AdapterView<?> arg0, View arg1, int position,long arg3) {
			ShowFilePhotoActivity.dataList = (ArrayList<ImageItem>) ImageFileActivity.contentList.get(position).imageList;
			Intent intent = new Intent();
			String folderName = ImageFileActivity.contentList.get(position).bucketName;
			intent.putExtra("folderName", folderName);
			intent.setClass(ImageFileActivity.this, ShowFilePhotoActivity.class);
			startActivityForResult(intent, 100);
		}
	});
}
 
Example #28
Source File: CharacterisiticActivity.java    From bleTester with Apache License 2.0 5 votes vote down vote up
@SuppressLint("NewApi")
private void init() {
	lv = (ListView) findViewById(R.id.lv_charList);
	lv.setEmptyView(findViewById(R.id.pb_empty2));
	charListAdapter = new CharacterisiticListAdapter(this);
	lv.setAdapter(charListAdapter);
	lv.setOnItemClickListener(new OnItemClickListener() {

		@SuppressLint("NewApi")
		@Override
		public void onItemClick(AdapterView<?> arg0, View view,
				int position, long arg3) {
			// TODO Auto-generated method stub
			Intent mIntent = new Intent(CharacterisiticActivity.this,
					ChangeCharActivity.class);
			UUID charUuid = bleService.mBluetoothGatt.getService(uuid)
					.getCharacteristics().get(position).getUuid();
			mIntent.putExtra("charUUID", charUuid);
			mIntent.putExtra("properties", bleService.mBluetoothGatt
					.getService(uuid).getCharacteristics().get(position)
					.getProperties());
			mIntent.putExtra("serUUID", uuid);
			startActivity(mIntent);
		}
	});

}
 
Example #29
Source File: GosModeListActivity.java    From GOpenSource_AppKit_Android_AS with MIT License 5 votes vote down vote up
private void initEvent() {

		lvMode.setOnItemClickListener(new OnItemClickListener() {

			@Override
			public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {

				GosAirlinkChooseDeviceWorkWiFiActivity.modeNum = arg2;
				Intent intent = new Intent(GosModeListActivity.this, GosAirlinkReadyActivity.class);
				startActivity(intent);
				finish();
			}
		});
	}
 
Example #30
Source File: ListLicenseView.java    From BotLibre with Eclipse Public License 1.0 5 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);
	setContentView(R.layout.activity_list_view);
	llview = (ListView) findViewById(R.id.theListView);
	txt = (TextView) findViewById(R.id.theTitle);
	
	txt.setText("Select License");
	
	@SuppressWarnings({ "unchecked", "rawtypes" })
	ArrayAdapter adapter = new ArrayAdapter(this,
	android.R.layout.select_dialog_item, listS);
	llview.setAdapter(adapter);
	
	
	
	llview.setOnItemClickListener(new OnItemClickListener() {

		@Override
		public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {
			Toast.makeText(ListLicenseView.this, listS[arg2] + " Selected", Toast.LENGTH_SHORT).show();
			data.putExtra("temp", listS[arg2]);
			setResult(RESULT_OK,data);
			finish();
		}
	});
}