Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.splash);
- final Thread splashThread = new Thread() {
- @Override
- public void run() {
- try {
- int wait = 0;
- while (_isActive && (_splashTime > wait)) {
- sleep(100);
- if (_isActive) {
- wait += 100;
- }
- }
- } catch (InterruptedException e) {
- Log.d(TAG, e.getMessage());
- } finally {
- startActivity(new Intent("com.path1.path2.SomeActivity"));
- finish();
- }
- }
- };
- splashThread.start();
- }
- <?xml version="1.0" encoding="utf-8"?>
- <manifest xmlns:android="http://schemas.android.com/apk/res/android"
- package="com.path1.path2"
- android:versionCode="2"
- android:versionName="1.0">
- <uses-sdk android:minSdkVersion="4"/>
- <!--permissions-->
- <uses-permission android:name="android.permission.INTERNET"/>
- <uses-permission android:name="android.permission.READ_PHONE_STATE"/>
- <application android:label="@string/app_name" android:icon="@drawable/icon">
- <activity android:name=".SplashActivity"
- android:label="@string/app_name"
- >
- <intent-filter>
- <action android:name="android.intent.action.MAIN"/>
- <category android:name="android.intent.category.LAUNCHER"/>
- </intent-filter>
- </activity>
- <activity android:name=".SomeActivity"
- android:label="@string/app_name"
- >
- <intent-filter>
- <action android:name="com.path1.path2.SomeActivity"/>
- <category android:name="android.intent.category.DEFAULT"/>
- </intent-filter>
- </activity>
- <activity android:name=".OtherActivity" android:label="@string/app_name"
- />
- <!--services-->
- <service android:name=".AlarmService"/>
- </application>
- </manifest>
- Launching application: com.path1.pathOLD/com.path1.path2.SplashActivity.
- DEVICE SHELL COMMAND: am start -n "com.path1.pathOLD/com.path1.path2.SplashActivity"
- Starting: Intent { cmp=com.path1.pathOLD/com.path1.path2.SplashActivity }
- Error type 3
- Error: Activity class {com.path1.pathOLD/com.path1.path2.SplashActivity} does not exist.
- <?xml version="1.0" encoding="utf-8"?>
- <manifest xmlns:android="http://schemas.android.com/apk/res/android"
- package="com.path1.path2"
- android:versionCode="2"
- android:versionName="1.0">
- <uses-sdk android:minSdkVersion="4"/>
- <!--permissions-->
- <uses-permission android:name="android.permission.INTERNET"/>
- <uses-permission android:name="android.permission.READ_PHONE_STATE"/>
- <application android:label="@string/app_name" android:icon="@drawable/icon">
- <activity android:name=".SplashActivity"
- android:label="@string/app_name"
- >
- <intent-filter>
- <action android:name="android.intent.action.MAIN"/>
- <category android:name="android.intent.category.LAUNCHER"/>
- </intent-filter>
- </activity>
- <activity android:name=".SomeActivity"
- android:label="@string/app_name"
- >
- <intent-filter>
- <category android:name="android.intent.category.DEFAULT"/>
- </intent-filter>
- </activity>
- <activity android:name=".OtherActivity" android:label="@string/app_name"
- />
- <!--services-->
- <service android:name=".AlarmService"/>
- </application>
- 1. Go to ~/.gradle/ and delete caches folder
- rm -r caches
- 2. "Sync project with Gradle files" icon on Android Studio
- 3. Run project
- <activity android:name=".SplashActivity"
- <activity android:name="com.path1.path2.SplashActivity"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement