mirror of
https://github.com/2009scape/2009Scape-mobile.git
synced 2025-12-12 01:21:09 -07:00
Implement AWT (1.12.2-) link opening
TODO: DIrectory opening
This commit is contained in:
parent
6714813eec
commit
33d7d854ae
4 changed files with 49 additions and 1 deletions
|
|
@ -17,6 +17,7 @@ import android.content.res.Configuration;
|
|||
import android.graphics.Color;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.os.*;
|
||||
import android.provider.DocumentsContract;
|
||||
import android.util.*;
|
||||
import android.view.*;
|
||||
import android.widget.*;
|
||||
|
|
@ -519,6 +520,18 @@ public class MainActivity extends BaseActivity implements ControlButtonMenuListe
|
|||
}
|
||||
});
|
||||
}
|
||||
public static void openPath(String path) {
|
||||
Context ctx = touchpad.getContext(); // no more better way to obtain a context statically
|
||||
((Activity)ctx).runOnUiThread(() -> {
|
||||
try {
|
||||
Intent intent = new Intent(Intent.ACTION_VIEW);
|
||||
intent.setDataAndType(DocumentsContract.buildDocumentUri(ctx.getString(R.string.storageProviderAuthorities), path), "*/*");
|
||||
ctx.startActivity(intent);
|
||||
} catch (Throwable th) {
|
||||
Tools.showError(ctx, th);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClickedMenu() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue