android


How to call a new activity in the OnClickListener () LazyAdapter


I want to call a new activity via click on the picture on the lazy adapter, but why in the following line appears Intent error "The constructor Intent(LazyAdapter, Class) is undefined"
// Click on Image
gambar.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
String strImageID = data.get(position).get("ImageID").toString();
String strImageName = data.get(position).get("ImageName").toString();
String strImagePathFull = data.get(position).get("ImagePathFull").toString();
Intent newActivity = new Intent(LazyAdapter.this,VoteActivity.class); //Line error
newActivity.putExtra("ImageID", strImageID);
newActivity.putExtra("ImageName", strImageName);
newActivity.putExtra("ImagePathFull", strImagePathFull);
startActivity(newActivity); //line error
}
});
What steps am I doing wrong to call new activity in lazyadapter. I plan images on LazyList can be clicked, then appear a new activity with the bigger picture.
Please help, am I wrong to call a new activity. What should I do so that the image can be clicked LazyList then performed with a full-size image and then do the voting.
It should be context of your Activity not the Adapter class,
Intent newActivity = new Intent(YourActivity.this,VoteActivity.class);
instead of
Intent newActivity = new Intent(LazyAdapter.this,VoteActivity.class);

Related Links

Retrieving other view inside ListView item from inside TextWatcher
Link Queries with Realm Android
Android studio Image uploading error Firebase
How to using SharedPreference in ToggleButton Android?
Unable to add header in mikepenz material drawer
Map inside fragment list
Xamarin.Forms.Platform.Android.ViewRenderer`2.CreateNativeControl' not found
findFragmentByTag for viewPagers fragments always returns null
HTTP request works using 'curl' but doesn't work from java code(notifications, FCM)
Skip utterances in Android TTS
Shared Preference save Textview background
How to successfully upload my app to the play store without WebViewClient.onReceivedSslError
Bluetooth Headset Button input
Android long Internet connect when starting after phone been locked
How to fill all space in parent Relative layout?
Android Update SSL Certificate

Categories

HOME
go
apache-flink
android-studio-2.2
depth
yahoo-finance
pclxl
r-googlesheets
appcelerator
opendj
edge
web-hosting
mapbox
jquery-ui
mod-security
activecollab
mautic
digital-signature
mapstruct
solrcloud
ag
springfox
ember-cli
direct3d11
expressionengine3
xcode-ui-testing
has-and-belongs-to-many
firebase-analytics
twiml
scrollview
autodesk-designautomation
mobx
livelink
sendbird
hunspell
getlasterror
typesafe-config
android-ibeacon
install.packages
avcapturedevice
opencmis
activeperl
datamaps
manova
openblas
carrot2
magic-draw
oracleclient
backbone-collections
mouseleave
monkey
rackspace-cloud
pybrain
universal-analytics
django-1.10
rsa-archer-grc
autosar
segment-io
vulcanize
iotivity
uicolor
jclouds
fuzzywuzzy
np-spring
assertion
ocra
jsvc
android-cookiemanager
linkedin-jsapi
imagefilter
raygun
functional-java
gae-quotas
xmltodict
jquery-1.9
windows-98
preload
boost-msm
paginator
cuda-gdb
extconf.rb
stress
tmx
wordprocessingml
entitykey
information-management

Resources

Encrypt Message