本文整理汇总了Java中com.ipaulpro.afilechooser.utils.FileUtils.isLocal方法的典型用法代码示例。如果您正苦于以下问题:Java FileUtils.isLocal方法的具体用法?Java FileUtils.isLocal怎么用?Java FileUtils.isLocal使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.ipaulpro.afilechooser.utils.FileUtils
的用法示例。
在下文中一共展示了FileUtils.isLocal方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onActivityResult
import com.ipaulpro.afilechooser.utils.FileUtils; //导入方法依赖的package包/类
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
switch (requestCode) {
case Constants.REQUEST_CHOOSER:
if (resultCode == RESULT_OK) {
final Uri uri = data.getData();
// Get the File path from the Uri
String path = FileUtils.getPath(this, uri);
Toast.makeText(this, "Choosen file: " + path,Toast.LENGTH_LONG).show();
// Alternatively, use FileUtils.getFile(Context, Uri)
if (path != null && FileUtils.isLocal(path)) {
File file = new File(path);
}
// Create the intent to start video activity
Intent i = new Intent(MainActivity.this, LocalVideoActivity.class);
i.putExtra(Constants.EXTRA_ANSWER_IS_TRUE,path);
startActivity(i);
}
break;
}
}
示例2: onActivityResult
import com.ipaulpro.afilechooser.utils.FileUtils; //导入方法依赖的package包/类
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data)
{
switch (requestCode) {
case REQUEST_CODE:
if (resultCode == RESULT_OK) {
final Uri uri = data.getData();
// Get the File path from the Uri
String path = FileUtils.getPath(this, uri);
// Alternatively, use FileUtils.getFile(Context, Uri)
if (path != null && FileUtils.isLocal(path)) {
File file = new File(path);
processSelectedPic(file);
}
}
break;
}
super.onActivityResult(requestCode, resultCode, data);
}
示例3: onActivityResult
import com.ipaulpro.afilechooser.utils.FileUtils; //导入方法依赖的package包/类
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data)
{
switch (requestCode) {
case PATH_REQUEST_CODE:
if (resultCode == RESULT_OK) {
final Uri uri = data.getData();
// Get the File path from the Uri
String path = FileUtils.getPath(this, uri);
// Alternatively, use FileUtils.getFile(Context, Uri)
if (path != null && FileUtils.isLocal(path)) {
File file = new File(path);
pathPref.setValue(file);
}
}
break;
case MAC_REQUEST_CODE:
if (resultCode == RESULT_OK) {
String name = data.getExtras().get(getString(R.string.extras_return_name)).toString();//Yay! I can't store 2 values using Preferences(extending Preferences)
String mac = data.getExtras().get(getString(R.string.extras_return_mac)).toString();
btFinderPref.setValue(mac);
}
break;
}
getPreferences(0);
}
示例4: onActivityResult
import com.ipaulpro.afilechooser.utils.FileUtils; //导入方法依赖的package包/类
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
switch (requestCode) {
case REQUEST_CHOOSER:
if (resultCode == RESULT_OK) {
final Uri uri = data.getData();
final String path = FileUtils.getPath(this, uri);
if (path != null && FileUtils.isLocal(path)) {
showDecryptDialog(path);
}
}
break;
}
}
示例5: setCurrentDocumentUri
import com.ipaulpro.afilechooser.utils.FileUtils; //导入方法依赖的package包/类
public void setCurrentDocumentUri(Uri newDocumentUri) {
try {
String path = FileUtils.getPath(this, newDocumentUri);
if(path != null && FileUtils.isLocal(path) && isFileFormatSupported(path)) {
currentDocumentPath = path;
} else {
Toast.makeText(this, R.string.print_file_not_supported, Toast.LENGTH_SHORT).show();
}
} catch (Exception e){
Toast.makeText(this, R.string.print_file_not_supported, Toast.LENGTH_SHORT).show();
}
}