i have an app. in my main file, i want to go to another activity. But before that, i want to show some pictures. i saw already some topics here but they cant help me.
this is my idea:
when loading the next screen i want to show different picture But 1 at 1 time, with an interval of 4 seconds and with a nice transition.
i hope somebody can help me ? please help me so quickly as possible.
here's my code:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<ProgressBar
android:id="@+id/progressBar1"
style="?android:attr/progressBarStyleLarge"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="32dp" />
</RelativeLayout>
here my java code:(everything between 2 stars give's an error)
class Main extends AsyncTask<Void, Void, Void> {
int i = 0;
protected Void doInBackground(Void... progress ) {
try {
while(i < 3)
{
publishProgress();
i++;
Thread.sleep(4000);
}
return null;
} catch (InterruptedException e) {
e.printStackTrace();
}
return null;
}
protected void onProgressUpdate(Void... j) {
Drawable image=null;
try{
int[] imgs = new int[]{R.drawable.grijs,R.drawable.home_afbeelding,R.drawable.menu};
image = getResources().**getDrawable**(imgs[i]);
}
catch(Exception e)
{
image = getResources().**getDrawable**(R.drawable.grijs);
**splashImage**.setImageDrawable(image);
}
**splashImage**.setImageDrawable(image);
}
private Object getResources() {
// TODO Auto-generated method stub
return null;
}
protected void onPostExecute(Void i) {
if(**changed** != true)
{
**changed** = true;
**finish()**;
**startActivity**(new **Intent**(**classContext()**,**NewActivity**.class));
}
}
}