1. activity하나 만듬.
2. nullpointerexception 방지를 위해 manifest에 추가.
android:configChanges="orientation|screenSize"
3.
public class Intro extends Activity {
Intent intent = null;
@Override
onCreate {
System.gc();
....
Handler x = new Handler();
x.postDelayed(new splashHandler(), 1000);
}
public class splashHandler implements Runnable {
public void run() {
Intent intent = new Intent(getApplicationContext(),
Jump.class);
startActivity(intent);
finish();
}
}
private void clearApplicationCache(java.io.File dir) {
if (dir == null)
dir = getCacheDir();
else
;
if (dir == null)
return;
java.io.File[] children = dir.listFiles();
try {
for (int i=0; i < children.length; i++)
if (children[i].isDirectory())
clearApplicationCache(children[i]);
else
children[i].delete();
} catch (Exception e) {
}
}
@Override
public void onDestory() {
super.onDestory();
clearApplicationCache(null);
}
}
댓글 없음:
댓글 쓰기