Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

expo draw over other apps

@ReactMethod
public void startService(Promise promise) {

    String result = "Success";
    Activity activity = getCurrentActivity();
    if (activity != null) {
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M && !Settings.canDrawOverlays(getReactApplicationContext())) {
            Intent intent = new Intent(Settings.ACTION_MANAGE_OVERLAY_PERMISSION,
                    Uri.parse("package:" + getCurrentActivity().getPackageName()));
            getCurrentActivity().startActivityForResult(intent, MainActivity.DRAW_OVER_OTHER_APP_PERMISSION_REQUEST_CODE);
        }
    }
    try {
        Intent intent = new Intent(FloatingWidgetService.FLOATING_WIDGET_ID);
        intent.setClass(this.getReactApplicationContext(), FloatingWidgetService.class);
        getReactApplicationContext().startService(intent);
        FloatingWidgetService.setUri(uri);
    } catch (Exception e) {
        promise.reject(e);
        return;
    }
    promise.resolve(result);
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: display prety html json data 
Javascript :: 3.4.2. Two Special Characters¶ 
Javascript :: 4.4.3. Keywords¶ 
Javascript :: 5.1.1. Boolean Values¶ 
Javascript :: how to toglle button in viewjs 
Javascript :: nodejs hpp github 
Javascript :: express orm 
Javascript :: SyntaxError 
Javascript :: class exists javascript 
Javascript :: 7.3.2. Length or .length 
Javascript :: javascript function to print hello world 
Javascript :: 9.5. The Accumulator Pattern¶ 
Javascript :: Shorthand for calling functions conditionally 
Javascript :: 10.4.2. Functions // Default Value 
Javascript :: must line ending of word regex match 
Javascript :: how to check if an image exists in js from cross origin 
Javascript :: jquery ui sortable disable child 
Javascript :: Get Multipal Tab Value to One App Script 
Javascript :: ternary operator online 
Javascript :: how to require token in discord.js without client 
Javascript :: codeigniter get raw query 
Javascript :: vue send event plus variable 
Javascript :: limit values that satisy a url parameter react-router 
Javascript :: blank array condition in react js 
Javascript :: javascript array game 
Javascript :: Ajax Mixed content blocked 
Javascript :: networkx explore nodes 
Javascript :: React custom hook refetch data 
Javascript :: veu js vs angular vs react features 
Javascript :: link the filename to the visible layer 
ADD CONTENT
Topic
Content
Source link
Name
8+1 =