android cancel animation cause stackoverflow error - android

i am trying to use animation to zoom image. But it seem there have some problem i can not know why it appear....
Please help me solve this problem...
imgAlpha.setOnLongClickListener(new OnLongClickListener() {
#Override
public boolean onLongClick(View v) {
// TODO Auto-generated method stub
List<Animator> animations = new ArrayList<Animator>();
animations.add(ObjectAnimator.ofFloat(imgAlpha,
View.SCALE_X, 2).setDuration(800));
animations.add(ObjectAnimator.ofFloat(imgAlpha,
View.SCALE_Y, 2).setDuration(800));
final AnimatorSet animatorSet = new AnimatorSet();
animatorSet.playTogether(animations);
animatorSet.start();
animatorSet.setDuration(800);
animatorSet.addListener(new AnimatorListener() {
#Override
public void onAnimationStart(Animator animation) {
// TODO Auto-generated method stub
}
#Override
public void onAnimationRepeat(Animator animation) {
// TODO Auto-generated method stub
}
#Override
public void onAnimationEnd(final Animator animation) {
// TODO Auto-generated method stub
// TODO Auto-generated method stub
Logger.error("end animation");
animatorSet.cancel();
imgAlpha.clearAnimation();
}
#Override
public void onAnimationCancel(Animator animation) {
// TODO Auto-generated method stub
Logger.error("calcel animation");
}
});
return true;
}
});
I do not know when it cause error on end animation. please help me
UPDATE:
OBJECT ANIMATOR CAN NOT USE AS OTHER ANIMATION, IT CAN NOT BACK TO ORIGINAL SIZE AS I EXPECT. I THINK SO, IF OTHER PEOPLE KNOW HOW TO SOLVE IT, PLEASE TEACH ME OUT OF PROBLEM. MANY THANKS

#Override
public void onAnimationEnd(final Animator animation) {
// TODO Auto-generated method stub
// TODO Auto-generated method stub
Log.e("error", "end animation");
**// animatorSet.cancel();**
img.clearAnimation();
}
package com.example.count;
import java.util.ArrayList;
import java.util.List;
import android.animation.Animator;
import android.animation.Animator.AnimatorListener;
import android.animation.AnimatorSet;
import android.animation.ObjectAnimator;
import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.View.OnLongClickListener;
import android.widget.Button;
import android.widget.ImageView;
public class main extends Activity{
Button b1;
ImageView img;
#Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.first);
img=(ImageView)findViewById(R.id.imageView1);
img.setOnLongClickListener(new OnLongClickListener() {
#Override
public boolean onLongClick(View v) {
// TODO Auto-generated method stub
List<Animator> animations = new ArrayList<Animator>();
animations.add(ObjectAnimator.ofFloat(img,
View.SCALE_X, 2).setDuration(800));
animations.add(ObjectAnimator.ofFloat(img,
View.SCALE_Y, 2).setDuration(800));
final AnimatorSet animatorSet = new AnimatorSet();
animatorSet.playTogether(animations);
animatorSet.start();
animatorSet.setDuration(800);
animatorSet.addListener(new AnimatorListener() {
#Override
public void onAnimationStart(Animator animation) {
// TODO Auto-generated method stub
}
#Override
public void onAnimationRepeat(Animator animation) {
// TODO Auto-generated method stub
}
#Override
public void onAnimationEnd(final Animator animation) {
// TODO Auto-generated method stub
// TODO Auto-generated method stub
Log.e("error", "end animation");
// animatorSet.cancel();
img.clearAnimation();
}
#Override
public void onAnimationCancel(Animator animation) {
// TODO Auto-generated method stub
Log.e("error", "calcel animation");
}
});
return true;
}
});
}
}

AnimatorSet.end() fires onAnimationEnd(Animator) hence a recursion.
See documentation:
Ends the animation. This causes the animation to assign the end value of the property being animated, then calling the onAnimationEnd(Animator) method on its listeners.

Related

Using animation in android 4.0

I am using this code to animate childViews in a ViewGroup on screen:
zoom_in.setAnimationListener(new Animation.AnimationListener() {
#Override
public void onAnimationStart(Animation animation) {
// TODO Auto-generated method stub
viewGroup.getChildAt(i).setVisibility(View.VISIBLE);
viewGroup.getChildAt(i).clearAnimation();
if(i<5)
{
i++;
viewGroup.getChildAt(i).startAnimation(animation);
}
else
{
i=0;
}
}
#Override
public void onAnimationRepeat(Animation animation) {
// TODO Auto-generated method stub
}
#Override
public void onAnimationEnd(Animation animation) {
// TODO Auto-generated method stub
}
});
zoom_out.setAnimationListener(new Animation.AnimationListener() {
#Override
public void onAnimationStart(Animation animation) {
// TODO Auto-generated method stub
}
#Override
public void onAnimationRepeat(Animation animation) {
// TODO Auto-generated method stub
}
#Override
public void onAnimationEnd(Animation animation) {
// TODO Auto-generated method stub
viewGroup.getChildAt(i).setVisibility(View.INVISIBLE);
viewGroup.getChildAt(i).clearAnimation();
if(i<5)
{
i++;
viewGroup.getChildAt(i).startAnimation(animation);
}
else
{
viewGroup.getChildAt(i).startAnimation(zoom_in);
i=0;
}
}
});
The animation zoom_in and zoom_out are simple zoom in and zoom out animations. When I run this code on Android 4.2 or higher it works perfectly. But on lower then it doesnot work similarly. Can anyone explain me or provide any solution for this problem. I want it to work similar on all devices 4.0 and higher.

Animation on android make device to lag

I need some information why my animation are making devices to lag. The current problem is seen in Samsung Galaxy Tab Pro 8.4'', but in all devices the are slight lags, kaing writing on keyboard heavy. Thank you for your cooperation !!! :)
PS: Thanks Mikael :). Here is some code. Its complicated animation and it contains several parts very similar to this one with combine animation of several views.
CODE :
mTriangleButton.setOnClickListener(new OnClickListener() {
#Override
public void onClick(View v) {
mLearnMore = (LinearLayout) ((LoginActivity) context)
.findViewById(R.id.learn_more);
if (mAccNameEmail.isShown()) {
// Slider
if (BookshelfApp.isTablet(context)) {
if(getActivity().getResources().getConfiguration().orientation==Configuration.ORIENTATION_LANDSCAPE) {
mDeseretLogo.setVisibility(View.VISIBLE);
mSquigle.setVisibility(View.VISIBLE);
mBorder.setVisibility(View.VISIBLE);
imm.toggleSoftInput(InputMethodManager.RESULT_HIDDEN, 0);
}
view.animate().translationX(0);
view.animate().setDuration(500);
mLearnMore.animate().translationX(0);
mLearnMore.animate().setDuration(500);
mLearnMore.animate().setListener(new Animator.AnimatorListener() {
#Override
public void onAnimationStart(Animator animation) {
mLearnMore.setVisibility(View.GONE);
}
#Override
public void onAnimationRepeat(Animator animation) {
// TODO Auto-generated method stub
}
#Override
public void onAnimationEnd(Animator animation) {
// TODO Auto-generated method stub
}
#Override
public void onAnimationCancel(Animator animation) {
// TODO Auto-generated method stub
}
});
//XXX
} else if (!BookshelfApp.isTablet(context)) {
mCreateAccFragment.animate().translationY(0);
mDeseretLogo.setVisibility(View.VISIBLE);
mSquigle.setVisibility(View.VISIBLE);
mBorder.setVisibility(View.VISIBLE);
}
mTextHint1.setVisibility(View.VISIBLE);
mTextHint2.setVisibility(View.VISIBLE);
mTriangleButton.animate().rotation(0);
mTriangleButton.animate().setDuration(500);
mAccPasswords.setVisibility(View.GONE);
mAccNameEmail.setVisibility(View.GONE);
mSignUpButton.setBackgroundDrawable(getResources()
.getDrawable(R.drawable.sign_up_shape));
mSignUpButton.setTextColor(getResources().getColor(
R.color.orange));
mLoginFormView.setVisibility(View.VISIBLE);
mSignInButton.setVisibility(View.VISIBLE);
mForgotPasswordView.setVisibility(View.VISIBLE);
mCreateAccountQuestion
.setText(R.string.acc_question_welcome);
mCreateAccountWord.setText(R.string.acc_welcome);
mHaveAccountButton.setVisibility(View.GONE);
} else {
// Slider
if (BookshelfApp.isTablet(context)) {
if(getActivity().getResources().getConfiguration().orientation==Configuration.ORIENTATION_LANDSCAPE) {
mDeseretLogo.setVisibility(View.GONE);
mSquigle.setVisibility(View.GONE);
mBorder.setVisibility(View.GONE);
imm.toggleSoftInput(InputMethodManager.RESULT_SHOWN, 0);
}
view.animate().translationX(-view.getWidth() / 4);
view.animate().setDuration(500);
mLearnMore.animate().translationX(view.getWidth() / 2);
mLearnMore.animate().setDuration(500);
mLearnMore.animate().setListener(new Animator.AnimatorListener() {
#Override
public void onAnimationStart(Animator animation) {
// TODO Auto-generated method stub
}
#Override
public void onAnimationRepeat(Animator animation) {
// TODO Auto-generated method stub
}
#Override
public void onAnimationEnd(Animator animation) {
mLearnMore.setVisibility(View.VISIBLE);
}
#Override
public void onAnimationCancel(Animator animation) {
// TODO Auto-generated method stub
}
});
}
//XXX
else if (!BookshelfApp.isTablet(context)) {
mDeseretLogo.setVisibility(View.GONE);
mSquigle.setVisibility(View.GONE);
mBorder.setVisibility(View.GONE);
}
mTextHint1.setVisibility(View.GONE);
mTextHint2.setVisibility(View.GONE);
mLoginFormView.setVisibility(View.GONE);
mSignInButton.setVisibility(View.GONE);
mForgotPasswordView.setVisibility(View.GONE);
mTriangleButton.animate().rotation(180);
mTriangleButton.animate().setDuration(300);
mAccPasswords.setVisibility(View.VISIBLE);
mAccNameEmail.setVisibility(View.VISIBLE);
mSignUpButton.setBackgroundDrawable(getResources()
.getDrawable(R.drawable.sign_in_shape));
mSignUpButton.setTextColor(getResources().getColor(
R.color.white));
mCreateAccountQuestion.setText(R.string.acc_question);
mCreateAccountWord.setText(R.string.acc_done);
mHaveAccountButton.setVisibility(View.VISIBLE);
}
}
});

Perform action at the end of animation

I've write an Animation for make text of a TextView blink, and i would perform an action after animation ends.
It's possible to intercept end of animation in some way?
AnimationListener listener = new AnimationListener() {
#Override
public void onAnimationStart(Animation animation) {
// TODO Auto-generated method stub
}
#Override
public void onAnimationRepeat(Animation animation) {
// TODO Auto-generated method stub
}
#Override
public void onAnimationEnd(Animation animation) {
// Do your stuff
}
};

My app is not working in emulator..please help me out

This is the code I would like you to go through.
Please spot my mistakes.
This is a simple code for a calculator app.
I am not sure but the mistake might be in button section of the code.
Would be really grateful if you helped me out in this..
Thanks in advance.
package com.iitg.sau_calc;
import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
public class Cal extends Activity {
Button one, two, thr, fou, fiv, six, sev, eig, nin, zer, add, sub, mul, div, clr, equ;
TextView scr;
int ans=0,fans=0,ca=0,cs=0,cm=0,cd=0;
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_cal);
one=(Button)findViewById(R.id.one);
two=(Button)findViewById(R.id.two);
thr=(Button)findViewById(R.id.thr);
fou=(Button)findViewById(R.id.fou);
fiv=(Button)findViewById(R.id.fiv);
six=(Button)findViewById(R.id.six);
sev=(Button)findViewById(R.id.sev);
eig=(Button)findViewById(R.id.eig);
nin=(Button)findViewById(R.id.nin);
zer=(Button)findViewById(R.id.zer);
add=(Button)findViewById(R.id.add);
sub=(Button)findViewById(R.id.sub);
mul=(Button)findViewById(R.id.mul);
div=(Button)findViewById(R.id.div);
clr=(Button)findViewById(R.id.clr);
equ=(Button)findViewById(R.id.equ);
scr=(TextView)findViewById(R.id.Screen);
one.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View v) {
// TODO Auto-generated method stub
ans=ans*10+1;
scr.setText(ans);
}
});
two.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View v) {
// TODO Auto-generated method stub
ans=ans*10+2;
scr.setText(ans);
}
});
thr.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View v) {
// TODO Auto-generated method stub
ans=ans*10+3;
scr.setText(ans);
}
});
fou.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View v) {
// TODO Auto-generated method stub
ans=ans*10+4;
scr.setText(ans);
}
});
fiv.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View v) {
// TODO Auto-generated method stub
ans=ans*10+5;
scr.setText(ans);
}
});
six.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View v) {
// TODO Auto-generated method stub
ans=ans*10+6;
scr.setText(ans);
}
});
sev.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View v) {
// TODO Auto-generated method stub
ans=ans*10+7;
scr.setText(ans);
}
});
eig.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View v) {
// TODO Auto-generated method stub
ans=ans*10+8;
scr.setText(ans);
}
});
nin.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View v) {
// TODO Auto-generated method stub
ans=ans*10+9;
scr.setText(ans);
}
});
zer.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View v) {
// TODO Auto-generated method stub
ans=ans*10;
scr.setText(ans);
}
});
add.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View v) {
// TODO Auto-generated method stub
Ans();
ca+=1;
scr.setText("+");
}
});
sub.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View v) {
// TODO Auto-generated method stub
Ans();
cs+=1;
scr.setText("-");
}
});
mul.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View v) {
// TODO Auto-generated method stub
Ans();
cm+=1;
scr.setText("*");
}
});
div.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View v) {
// TODO Auto-generated method stub
Ans();
cd+=1;
scr.setText("/");
}
});
equ.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View v) {
// TODO Auto-generated method stub
Ans();
scr.setText(fans);
}
});
clr.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View v) {
// TODO Auto-generated method stub
ans=0;
fans=0;
ca=0;cm=0;cd=0;cs=0;
scr.setText("0");
}
});
}
public void Ans(){
if(ca>0)
{
fans=fans+ans;
ca=0;
}
else if(cs>0)
{
fans=fans-ans;
cs=0;
}
else if(cm>0)
{
fans=fans*ans;
cm=0;
}
else if(cd>0)
{
fans=fans/ans;
cd=0;
}
else
{
fans=ans;
ans=0;
}
}
#Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.cal, menu);
return true;
}
}
scr is textview and ans is a int. Your app probably crashes.
Replace this
scr.setText(ans);
By
scr.setText(String.ValueOf(ans));
public static String valueOf(int i)
Returns the string representation of the int argument.
Same for all
public final void setText (int resid)
resid is a resource which is an int value.
textView.setText(resid) looks for a resid with that value. If it's not found you will get ResourceNotFoundException.
You should use the below
public final void setText (CharSequence text)
takes a CharSequence as a param
http://developer.android.com/reference/android/widget/TextView.html#setText(int)
There might me other mistakes also (which may lead to crash). If its a crash its better you post the stacktrace.

how to load activity layout in android while the video is playing in background

how to load activity layout in android while the video is playing in background in android emulator???
the video demo you can see here
sample video
till now i have only animated the layout but i am unable to do like the one in video and when i am trying to play only video in emulator it gives error saying "can't play video"
actually i don't have an android device so i have to test my application in emulator.
any help is highly appreciated.
here is a code of animation :
package com.example.test;
import android.app.Activity;
import android.content.Intent;
import android.media.MediaPlayer;
import android.media.MediaPlayer.OnCompletionListener;
import android.media.MediaPlayer.OnPreparedListener;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.support.v4.app.NavUtils;
import android.view.MenuItem;
import android.view.MotionEvent;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.View.OnTouchListener;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.view.animation.Animation.AnimationListener;
import android.view.animation.TranslateAnimation;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.VideoView;
public class CorporateProfileActivity extends Activity implements OnPreparedListener, OnCompletionListener{
public ImageView bbhome, bbmap, bbprojects, bbcontact, bbprofile;
private VideoView video;
private ImageView ivcp1, ivcp2, ivcp3, ivcp4, ivcp5, ivcp6;
Animation forcp1, forcp2, forcp3, forcp4, forcp5, forcp6, animation;
View view, view1, view2;
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.profile);
//below bar variables
bbhome = (ImageView) findViewById(R.id.bbhome);
bbmap = (ImageView) findViewById(R.id.bbmap);
bbprojects = (ImageView) findViewById(R.id.bbprojects);
bbcontact = (ImageView) findViewById(R.id.bbcontact);
bbprofile = (ImageView) findViewById(R.id.bbprofile);
animation = AnimationUtils.loadAnimation(this, R.anim.intro_scale);
//animation.setFillAfter(true);
video=(VideoView) findViewById(R.id.VideoView1);
//images in order from left to right
ivcp1 = (ImageView)findViewById(R.id.cp1);
ivcp2 = (ImageView)findViewById(R.id.cp2);
ivcp3 = (ImageView)findViewById(R.id.cp3);
ivcp4 = (ImageView)findViewById(R.id.cp4);
ivcp5 = (ImageView)findViewById(R.id.cp5);
ivcp6 = (ImageView)findViewById(R.id.cp6);
forcp1 = new TranslateAnimation(-1500, 0, 0, 0);
forcp1.setDuration(700);
forcp2 = new TranslateAnimation(-1200, 0, 0, 0);
forcp2.setDuration(800);
forcp2.setAnimationListener(new AnimationListener() {
#Override
public void onAnimationStart(Animation animation) {
// TODO Auto-generated method stub
}
#Override
public void onAnimationRepeat(Animation animation) {
// TODO Auto-generated method stub
}
#Override
public void onAnimationEnd(Animation animation) {
// TODO Auto-generated method stub
ivcp1.setVisibility(1);
ivcp1.startAnimation(forcp1);
}
});
forcp3 = new TranslateAnimation(-1000, 0, 0, 0);
forcp3.setDuration(800);
forcp3.setAnimationListener(new AnimationListener() {
#Override
public void onAnimationStart(Animation animation) {
// TODO Auto-generated method stub
}
#Override
public void onAnimationRepeat(Animation animation) {
// TODO Auto-generated method stub
}
#Override
public void onAnimationEnd(Animation animation) {
// TODO Auto-generated method stub
ivcp2.setVisibility(1);
ivcp2.startAnimation(forcp2);
}
});
forcp4 = new TranslateAnimation(-500, 0, 0, 0);
forcp4.setDuration(800);
forcp4.setAnimationListener(new AnimationListener() {
#Override
public void onAnimationStart(Animation animation) {
// TODO Auto-generated method stub
}
#Override
public void onAnimationRepeat(Animation animation) {
// TODO Auto-generated method stub
}
#Override
public void onAnimationEnd(Animation animation) {
// TODO Auto-generated method stub
ivcp3.setVisibility(1);
ivcp3.startAnimation(forcp3);
}
});
forcp5 = new TranslateAnimation(-500, 0, 0, 0);
forcp5.setDuration(800);
forcp5.setAnimationListener(new AnimationListener() {
#Override
public void onAnimationStart(Animation animation) {
// TODO Auto-generated method stub
}
#Override
public void onAnimationRepeat(Animation animation) {
// TODO Auto-generated method stub
}
#Override
public void onAnimationEnd(Animation animation) {
// TODO Auto-generated method stub
ivcp4.setVisibility(1);
ivcp4.startAnimation(forcp4);
}
});
forcp6 = new TranslateAnimation(-500, 0, 0, 0);
forcp6.setDuration(800);
ivcp6.setVisibility(1);
ivcp6.startAnimation(forcp6);
forcp6.setAnimationListener(new AnimationListener() {
#Override
public void onAnimationStart(Animation animation) {
// TODO Auto-generated method stub
}
#Override
public void onAnimationRepeat(Animation animation) {
// TODO Auto-generated method stub
}
#Override
public void onAnimationEnd(Animation animation) {
// TODO Auto-generated method stub
ivcp5.setVisibility(1);
ivcp5.startAnimation(forcp5);
}
});
//image click events
ivcp1.setOnClickListener(new OnClickListener() {
#Override
public void onClick(View v) {
// TODO Auto-generated method stub
ivcp1.startAnimation(animation);
openIntro(view1);
}
});
ivcp2.setOnClickListener(new OnClickListener() {
#Override
public void onClick(View v) {
// TODO Auto-generated method stub
ivcp2.startAnimation(animation);
openWhoWeAre(view);
}
});
ivcp3.setOnClickListener(new OnClickListener() {
#Override
public void onClick(View v) {
// TODO Auto-generated method stub
ivcp3.startAnimation(animation);
openThwWayWeWork(v);
}
});
ivcp4.setOnClickListener(new OnClickListener() {
#Override
public void onClick(View v) {
// TODO Auto-generated method stub
ivcp4.startAnimation(animation);
openMisionVision(v);
}
});
ivcp5.setOnClickListener(new OnClickListener() {
#Override
public void onClick(View v) {
// TODO Auto-generated method stub
ivcp5.startAnimation(animation);
openOurPrinciples(v);
}
});
ivcp6.setOnClickListener(new OnClickListener() {
#Override
public void onClick(View v) {
// TODO Auto-generated method stub
ivcp6.startAnimation(animation);
openPromoter(v);
}
});
//onclick event for below bar menus
bbhome.setOnClickListener(new OnClickListener() {
#Override
public void onClick(View v) {
// TODO Auto-generated method stub
bbhome.setImageResource(R.drawable.home_active);
openMainActivity(v);
}
});
bbmap.setOnClickListener(new OnClickListener() {
#Override
public void onClick(View v) {
// TODO Auto-generated method stub
}
});
bbprojects.setOnClickListener(new OnClickListener() {
#Override
public void onClick(View v) {
// TODO Auto-generated method stub
}
});
bbcontact.setOnClickListener(new OnClickListener() {
#Override
public void onClick(View v) {
// TODO Auto-generated method stub
}
});
bbprofile.setOnClickListener(new OnClickListener() {
#Override
public void onClick(View v) {
// TODO Auto-generated method stub
}
});
}
//open methods to open activity
public void openIntro(View view) {
// Do something in response to button
Intent intent = new Intent(this, IntroductionActivity.class);
startActivity(intent);
}
public void openWhoWeAre(View view) {
// Do something in response to button
Intent intent = new Intent(this, WhoWeAreActivity.class);
startActivity(intent);
}
public void openThwWayWeWork(View view) {
// Do something in response to button
Intent intent = new Intent(this, WhoWeAreActivity.class);
startActivity(intent);
}
public void openMisionVision(View view) {
// Do something in response to button
Intent intent = new Intent(this, WhoWeAreActivity.class);
startActivity(intent);
}
public void openOurPrinciples(View view) {
// Do something in response to button
Intent intent = new Intent(this, WhoWeAreActivity.class);
startActivity(intent);
}
public void openPromoter(View view) {
// Do something in response to button
Intent intent = new Intent(this, WhoWeAreActivity.class);
startActivity(intent);
}
/*
#Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case android.R.id.home:
NavUtils.navigateUpFromSameTask(this);
return true;
}
return super.onOptionsItemSelected(item);
}
*/
#Override
public void onCompletion(MediaPlayer mp) {
// TODO Auto-generated method stub
System.out.println("video is complete...");
//imageView.setVisibility(View.VISIBLE);
//imageView.setScaleType(ImageView.ScaleType.FIT_XY);
}
#Override
public void onPrepared(MediaPlayer mp) {
// TODO Auto-generated method stub
}
public void openMainActivity(View view) {
// Do something in response to button
Intent intent = new Intent(this, MainActivity.class);
startActivity(intent);
}
}

Categories

Resources