Code Monkey home page Code Monkey logo

Comments (9)

zoontek avatar zoontek commented on July 23, 2024 1

Remove

<intent-filter>
  <action android:name="android.intent.action.MAIN" />
  <!-- <category android:name="android.intent.category.LAUNCHER" /> -->
</intent-filter>

From your MainActivity declaration.

from react-native-bootsplash.

zoontek avatar zoontek commented on July 23, 2024 1

Also, add exported key. Exactly like in the README

<activity
  android:name=".MainActivity"
  android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
  android:label="@string/app_name"
  android:windowSoftInputMode="adjustResize"
  android:exported="true"><!-- add this line -->
    <!-- remove the intent-filter from MainActivity -->
</activity>

from react-native-bootsplash.

zoontek avatar zoontek commented on July 23, 2024

@gamingumar I'm not sure it's linked to the lib. I see that com.tnfr.tnfr.MainActivity.onCreate does not exists. Can you post the com/tnfr/tnfr/MainActivity.java and your AndroidManifest.xml?

Edit: This lib does not rely on Fragment (neither do react-native). Do you use react-native-screens? If yes, which version? It could be the cause.

from react-native-bootsplash.

gamingumar avatar gamingumar commented on July 23, 2024

@zoontek That might be the cause.
I am using "react-native-screens": "^1.0.0-alpha.23",
Here are the files as you requested.

AndroidManifest.xml:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
  package="com.tnfr.tnfr">

    <uses-permission android:name="android.permission.INTERNET" />

    <application
      android:name=".MainApplication"
      android:label="@string/app_name"
      android:icon="@mipmap/ic_launcher"
      android:roundIcon="@mipmap/ic_launcher_circle"
      android:allowBackup="false"
      android:theme="@style/AppTheme">
      <activity
        android:name=".MainActivity"
        android:label="@string/app_name"
        android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
        android:windowSoftInputMode="adjustResize|adjustPan">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <!-- <category android:name="android.intent.category.LAUNCHER" /> -->
        </intent-filter>
      </activity>


      <!-- add the following lines react-native-bootsplash -->
      <activity
        android:name="com.zoontek.rnbootsplash.RNBootSplashActivity"
        android:theme="@style/BootTheme"> <!-- apply the theme you created at step 3. -->
        <intent-filter>
          <action android:name="android.intent.action.MAIN" />
          <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
      </activity>


      <activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
    </application>

</manifest>

MainActivity.java:

package com.tnfr.tnfr;

import android.os.Bundle; // <- add necessary import

import com.facebook.react.ReactActivity;

import com.zoontek.rnbootsplash.RNBootSplash; // <- add necessary import

import com.facebook.react.ReactActivityDelegate;
import com.facebook.react.ReactRootView;
import com.swmansion.gesturehandler.react.RNGestureHandlerEnabledRootView;

public class MainActivity extends ReactActivity {

    /**
     * Returns the name of the main component registered from JavaScript.
     * This is used to schedule rendering of the component.
     */
    @Override
    protected String getMainComponentName() {
        return "TNFR";
    }

    @Override
    protected ReactActivityDelegate createReactActivityDelegate() {
        return new ReactActivityDelegate(this, getMainComponentName()) {
        @Override
        protected ReactRootView createRootView() {
            return new RNGestureHandlerEnabledRootView(MainActivity.this);
        }
        };
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        RNBootSplash.show(R.drawable.bootsplash, MainActivity.this); // <- display the "bootsplash" xml view over our MainActivity
    }
}

from react-native-bootsplash.

gamingumar avatar gamingumar commented on July 23, 2024

Thanks @zoontek

from react-native-bootsplash.

gamingumar avatar gamingumar commented on July 23, 2024

Remove

<intent-filter>
  <action android:name="android.intent.action.MAIN" />
  <!-- <category android:name="android.intent.category.LAUNCHER" /> -->
</intent-filter>

From your MainActivity declaration.

I removed this line
<category android:name="android.intent.category.LAUNCHER" />
and the app icon won't show in launcher. After installing from playstore the open button also doesn't show up.

from react-native-bootsplash.

zoontek avatar zoontek commented on July 23, 2024

Please post your AndroidManifest.xml

from react-native-bootsplash.

gamingumar avatar gamingumar commented on July 23, 2024
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
  package="com.tnfr.tnfr">

    <uses-permission android:name="android.permission.INTERNET" />

    <application
      android:name=".MainApplication"
      android:label="@string/app_name"
      android:icon="@mipmap/ic_launcher"
      android:roundIcon="@mipmap/ic_launcher_circle"
      android:allowBackup="false"
      android:theme="@style/AppTheme">
      <activity
        android:name=".MainActivity"
        android:label="@string/app_name"
        android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
        android:windowSoftInputMode="adjustResize|adjustPan"
        android:exported="true">
      </activity>


      <!-- add the following lines react-native-bootsplash -->
      <activity
        android:name="com.zoontek.rnbootsplash.RNBootSplashActivity"
        android:theme="@style/BootTheme"> <!-- apply the theme you created at step 3. -->
        <intent-filter>
          <action android:name="android.intent.action.MAIN" />
          <!-- <category android:name="android.intent.category.LAUNCHER" /> -->
        </intent-filter>
      </activity>


      <activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
    </application>

</manifest>

@zoontek

from react-native-bootsplash.

zoontek avatar zoontek commented on July 23, 2024

When I said remove them, I mean remove both lines (the commented and the other), and put them in the other Activity 😅

And don't comment <category android:name="android.intent.category.LAUNCHER" />

Like this (same as what's in the README)

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
  package="com.tnfr.tnfr">

    <uses-permission android:name="android.permission.INTERNET" />

    <application
      android:name=".MainApplication"
      android:label="@string/app_name"
      android:icon="@mipmap/ic_launcher"
      android:roundIcon="@mipmap/ic_launcher_circle"
      android:allowBackup="false"
      android:theme="@style/AppTheme">
      <activity
        android:name=".MainActivity"
        android:label="@string/app_name"
        android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
        android:windowSoftInputMode="adjustResize|adjustPan"
        android:exported="true">
      </activity>

      <!-- add the following lines react-native-bootsplash -->
      <activity
        android:name="com.zoontek.rnbootsplash.RNBootSplashActivity"
        android:theme="@style/BootTheme"> <!-- apply the theme you created at step 3. -->
        <intent-filter>
          <action android:name="android.intent.action.MAIN" />
          <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
      </activity>


      <activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
    </application>

</manifest>

from react-native-bootsplash.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.