31 lines
842 B
Java
31 lines
842 B
Java
package com.uiui.aios.utils;
|
|
|
|
import android.app.Activity;
|
|
import android.content.Intent;
|
|
import android.net.Uri;
|
|
import android.text.TextUtils;
|
|
import android.util.Log;
|
|
|
|
public class SchemeUtils {
|
|
private static String TAG = SchemeUtils.class.getSimpleName();
|
|
|
|
public static final String SCHEME_TONGUE = "uiuihealth://tongue";
|
|
public static final String SCHEME_FACE = "uiuihealth://face";
|
|
public static final String SCHEME_HAND = "uiuihealth://hand";
|
|
|
|
public static void openScheme(Activity context, String uri) {
|
|
if (TextUtils.isEmpty(uri)) {
|
|
return;
|
|
}
|
|
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(uri));
|
|
try {
|
|
context.startActivity(intent);
|
|
} catch (Exception e) {
|
|
Log.e(TAG, "openScheme: " + e.getMessage());
|
|
}
|
|
}
|
|
|
|
|
|
|
|
}
|