overridePendingTransition in Image Adapter and View Holder
up vote
-1
down vote
favorite
I am trying to call an overridePendingTransition in a view holder. I have tried several solutions and haven't been able to find one that works. I have called the intent with the overridePendingTransition but doesn't work.
@Override
public void onBindViewHolder(ViewHolder holder, @SuppressLint("RecyclerView") final int position) {
String groupName = mDataset.get(position);
int groupImage = mGroupImageArray[position];
holder.mImageView.setBackgroundResource(groupImage);
holder.mTextViewGroupName.setText(groupName);
holder.mParentLayout.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent groupIntent = new Intent(mActivity, ShowGroupActivity.class);
groupIntent.putExtra("groupName", mDataset.get(position));
groupIntent.overridePendingTransition(R.anim.slide_in_right, R.anim.slide_out_left);
mActivity.startActivity(groupIntent);
}
});
}
java android
add a comment |
up vote
-1
down vote
favorite
I am trying to call an overridePendingTransition in a view holder. I have tried several solutions and haven't been able to find one that works. I have called the intent with the overridePendingTransition but doesn't work.
@Override
public void onBindViewHolder(ViewHolder holder, @SuppressLint("RecyclerView") final int position) {
String groupName = mDataset.get(position);
int groupImage = mGroupImageArray[position];
holder.mImageView.setBackgroundResource(groupImage);
holder.mTextViewGroupName.setText(groupName);
holder.mParentLayout.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent groupIntent = new Intent(mActivity, ShowGroupActivity.class);
groupIntent.putExtra("groupName", mDataset.get(position));
groupIntent.overridePendingTransition(R.anim.slide_in_right, R.anim.slide_out_left);
mActivity.startActivity(groupIntent);
}
});
}
java android
add a comment |
up vote
-1
down vote
favorite
up vote
-1
down vote
favorite
I am trying to call an overridePendingTransition in a view holder. I have tried several solutions and haven't been able to find one that works. I have called the intent with the overridePendingTransition but doesn't work.
@Override
public void onBindViewHolder(ViewHolder holder, @SuppressLint("RecyclerView") final int position) {
String groupName = mDataset.get(position);
int groupImage = mGroupImageArray[position];
holder.mImageView.setBackgroundResource(groupImage);
holder.mTextViewGroupName.setText(groupName);
holder.mParentLayout.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent groupIntent = new Intent(mActivity, ShowGroupActivity.class);
groupIntent.putExtra("groupName", mDataset.get(position));
groupIntent.overridePendingTransition(R.anim.slide_in_right, R.anim.slide_out_left);
mActivity.startActivity(groupIntent);
}
});
}
java android
I am trying to call an overridePendingTransition in a view holder. I have tried several solutions and haven't been able to find one that works. I have called the intent with the overridePendingTransition but doesn't work.
@Override
public void onBindViewHolder(ViewHolder holder, @SuppressLint("RecyclerView") final int position) {
String groupName = mDataset.get(position);
int groupImage = mGroupImageArray[position];
holder.mImageView.setBackgroundResource(groupImage);
holder.mTextViewGroupName.setText(groupName);
holder.mParentLayout.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent groupIntent = new Intent(mActivity, ShowGroupActivity.class);
groupIntent.putExtra("groupName", mDataset.get(position));
groupIntent.overridePendingTransition(R.anim.slide_in_right, R.anim.slide_out_left);
mActivity.startActivity(groupIntent);
}
});
}
java android
java android
asked Nov 8 at 2:45
User123
274
274
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
Intent
class does not have the method overridePendingTransition
, however you can it on an activity, say if your mActivity
is an Activity:
mActivity.overridePendingTransition(R.anim.slide_in_right, R.anim.slide_out_left);
mActivity.startActivity(groupIntent);
Otherwise, call the method somewhere in your activity that contains the RecyclerView
:
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
overridePendingTransition(R.anim.slide_in_right, R.anim.slide_out_left);
// continue ...
}
I get the errorerror: cannot find symbol method overridePendingTransition(int,int)
@Aaron
– User123
Nov 8 at 2:54
@User123 Is yourmActivity
anActivity
orContext
?
– Aaron
Nov 8 at 2:59
I am using context @Aaron
– User123
Nov 8 at 3:01
Either you changemActivity
type to Activity, or you call in on your activity. I've updated the answer, hope it works for you!
– Aaron
Nov 8 at 3:11
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
Intent
class does not have the method overridePendingTransition
, however you can it on an activity, say if your mActivity
is an Activity:
mActivity.overridePendingTransition(R.anim.slide_in_right, R.anim.slide_out_left);
mActivity.startActivity(groupIntent);
Otherwise, call the method somewhere in your activity that contains the RecyclerView
:
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
overridePendingTransition(R.anim.slide_in_right, R.anim.slide_out_left);
// continue ...
}
I get the errorerror: cannot find symbol method overridePendingTransition(int,int)
@Aaron
– User123
Nov 8 at 2:54
@User123 Is yourmActivity
anActivity
orContext
?
– Aaron
Nov 8 at 2:59
I am using context @Aaron
– User123
Nov 8 at 3:01
Either you changemActivity
type to Activity, or you call in on your activity. I've updated the answer, hope it works for you!
– Aaron
Nov 8 at 3:11
add a comment |
up vote
0
down vote
Intent
class does not have the method overridePendingTransition
, however you can it on an activity, say if your mActivity
is an Activity:
mActivity.overridePendingTransition(R.anim.slide_in_right, R.anim.slide_out_left);
mActivity.startActivity(groupIntent);
Otherwise, call the method somewhere in your activity that contains the RecyclerView
:
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
overridePendingTransition(R.anim.slide_in_right, R.anim.slide_out_left);
// continue ...
}
I get the errorerror: cannot find symbol method overridePendingTransition(int,int)
@Aaron
– User123
Nov 8 at 2:54
@User123 Is yourmActivity
anActivity
orContext
?
– Aaron
Nov 8 at 2:59
I am using context @Aaron
– User123
Nov 8 at 3:01
Either you changemActivity
type to Activity, or you call in on your activity. I've updated the answer, hope it works for you!
– Aaron
Nov 8 at 3:11
add a comment |
up vote
0
down vote
up vote
0
down vote
Intent
class does not have the method overridePendingTransition
, however you can it on an activity, say if your mActivity
is an Activity:
mActivity.overridePendingTransition(R.anim.slide_in_right, R.anim.slide_out_left);
mActivity.startActivity(groupIntent);
Otherwise, call the method somewhere in your activity that contains the RecyclerView
:
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
overridePendingTransition(R.anim.slide_in_right, R.anim.slide_out_left);
// continue ...
}
Intent
class does not have the method overridePendingTransition
, however you can it on an activity, say if your mActivity
is an Activity:
mActivity.overridePendingTransition(R.anim.slide_in_right, R.anim.slide_out_left);
mActivity.startActivity(groupIntent);
Otherwise, call the method somewhere in your activity that contains the RecyclerView
:
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
overridePendingTransition(R.anim.slide_in_right, R.anim.slide_out_left);
// continue ...
}
edited Nov 8 at 3:11
answered Nov 8 at 2:51
Aaron
1,5541212
1,5541212
I get the errorerror: cannot find symbol method overridePendingTransition(int,int)
@Aaron
– User123
Nov 8 at 2:54
@User123 Is yourmActivity
anActivity
orContext
?
– Aaron
Nov 8 at 2:59
I am using context @Aaron
– User123
Nov 8 at 3:01
Either you changemActivity
type to Activity, or you call in on your activity. I've updated the answer, hope it works for you!
– Aaron
Nov 8 at 3:11
add a comment |
I get the errorerror: cannot find symbol method overridePendingTransition(int,int)
@Aaron
– User123
Nov 8 at 2:54
@User123 Is yourmActivity
anActivity
orContext
?
– Aaron
Nov 8 at 2:59
I am using context @Aaron
– User123
Nov 8 at 3:01
Either you changemActivity
type to Activity, or you call in on your activity. I've updated the answer, hope it works for you!
– Aaron
Nov 8 at 3:11
I get the error
error: cannot find symbol method overridePendingTransition(int,int)
@Aaron– User123
Nov 8 at 2:54
I get the error
error: cannot find symbol method overridePendingTransition(int,int)
@Aaron– User123
Nov 8 at 2:54
@User123 Is your
mActivity
an Activity
or Context
?– Aaron
Nov 8 at 2:59
@User123 Is your
mActivity
an Activity
or Context
?– Aaron
Nov 8 at 2:59
I am using context @Aaron
– User123
Nov 8 at 3:01
I am using context @Aaron
– User123
Nov 8 at 3:01
Either you change
mActivity
type to Activity, or you call in on your activity. I've updated the answer, hope it works for you!– Aaron
Nov 8 at 3:11
Either you change
mActivity
type to Activity, or you call in on your activity. I've updated the answer, hope it works for you!– Aaron
Nov 8 at 3:11
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53200827%2foverridependingtransition-in-image-adapter-and-view-holder%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown