انجمن سایت کلیدستان


رتبه موضوع:
  • 1 رای - 5 میانگین
  • 1
  • 2
  • 3
  • 4
  • 5
stop غیر منتظره در اکتیویتی لوگو (اصلی)

stop غیر منتظره در اکتیویتی لوگو (اصلی)

#1
سلام دوستان و ادمین محترم

طبق کلید شماره 242 یه لوگو ساختم که بعد از طی چند ثانیه خودش خود به خود به اکتیویتی بعدی منتقل میشه،ولی وقتی رو امولیتور تستش کردم پیام زیر رو داد (stop غیر منتظره):

http://uupload.ir/files/6t3p_hflyih.png

اینم از کد های اکتیوی مربوط به لوگو (اکتیویتی اصلی)Sadدو تا هم انیمیشن اضافه کردم ولی مشکل من همون stop غیر منتظره ست)
http://uupload.ir/files/lddh_dfhjvnbgfjhn.png 
package com.example;
import android.os.Bundle;
import android.os.CountDownTimer;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.View;
import android.view.animation.AlphaAnimation;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.view.animation.DecelerateInterpolator;

public class Logo extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.xlogo);
        

        View myView = findViewById(R.id.imageView2);
        Animation fadeIn = new AlphaAnimation(0, 1);
        fadeIn.setInterpolator(new DecelerateInterpolator());
        fadeIn.setDuration(3000);
        myView.setVisibility(View.GONE);
        myView.setVisibility(View.VISIBLE);
        myView.setAnimation(fadeIn);

        View myView2 = findViewById(R.id.imageView1);
        Animation anim = AnimationUtils.loadAnimation(this, R.anim.rotate);
        myView2.setAnimation(anim);
       
        new CountDownTimer(5000,1000){
            @Override
            public void onTick(long millisUntilFinished){}

            @Override
                public void onFinish(){
                //set the new Content of your activity
                startActivity(new Intent(Logo.this, Menu.class));
            }
        }.start();
       
}


@Override
protected void onStop() {
    super.onStop();
    finish();
    }


    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.logo, menu);
        return true;
    }
    
}
 
 
پاسخ
 سپاس شده توسط hhossein73


پیام‌های این موضوع
stop غیر منتظره در اکتیویتی لوگو (اصلی) - توسط mina73 - ۱۳۹۴/۰۵/۲۸, ۰۴:۳۸ ب.ظ

پرش به انجمن:


کاربران در حال بازدید این موضوع: 1 مهمان