Last active
April 7, 2018 07:36
-
-
Save ShaileshPrajapati-BTC/19b1a8def87781e078348f35161123ba to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.toast; | |
import com.facebook.react.bridge.NativeModule; | |
import com.facebook.react.bridge.ReactApplicationContext; | |
import com.facebook.react.bridge.ReactContext; | |
import com.facebook.react.bridge.ReactContextBaseJavaModule; | |
import com.facebook.react.bridge.ReactMethod; | |
import android.widget.Toast; | |
public class ToastModule extends ReactContextBaseJavaModule { | |
public ToastModule(ReactApplicationContext reactContext) { | |
super(reactContext); | |
} | |
@Override | |
public String getName() { | |
return "ToastModule"; | |
} | |
@ReactMethod | |
public void show(string message) { | |
Toast.makeText(getReactApplicationContext(), message, Toast.LENGTH_LONG).show(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment