本文整理匯總了Java中com.nextgis.maplib.util.MapUtil.isParsable方法的典型用法代碼示例。如果您正苦於以下問題:Java MapUtil.isParsable方法的具體用法?Java MapUtil.isParsable怎麽用?Java MapUtil.isParsable使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.nextgis.maplib.util.MapUtil
的用法示例。
在下文中一共展示了MapUtil.isParsable方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: doInBackground
import com.nextgis.maplib.util.MapUtil; //導入方法依賴的package包/類
@Override
protected Void doInBackground(File... path) {
if (path.length > 0) {
if (path[0].exists() && path[0].isDirectory()) {
File[] data = path[0].listFiles();
int c = 0;
for (File file : data) {
publishProgress(++c, data.length);
if (file.isDirectory() && MapUtil.isParsable(file.getName()))
FileUtil.deleteRecursive(file);
}
}
}
return null;
}
示例2: bindView
import com.nextgis.maplib.util.MapUtil; //導入方法依賴的package包/類
private void bindView(int position, View view) {
final Map dataSet = mFiltered.get(position);
if (dataSet == null)
return;
final String[] from = mFrom;
final int[] to = mTo;
final int count = to.length;
for (int i = 0; i < count; i++) {
final View v = view.findViewById(to[i]);
if (v != null) {
final Object data = dataSet.get(from[i]);
String text = data == null ? "" : data.toString();
if (text == null)
text = "";
if (v instanceof Checkable) {
if (v instanceof TextView) {
TextView textView = (TextView) v;
// Note: keep the instanceof TextView check at the bottom of these
// ifs since a lot of views are TextViews (e.g. CheckBoxes).
setViewText(textView, text);
setIcon(textView, null);
String id = (String) dataSet.get(KEY_ICON);
if (id == null || !MapUtil.isParsable(id))
id = "default";
File icon = new File(mQMSIconsDir, id);
if (icon.exists())
setIcon(textView, icon.getPath());
else if (mIconsQueue.keySet().contains(id))
mIconsQueue.get(id).addViewWithIcon(textView);
else {
LoadIcon task = new LoadIcon(icon.getPath(), textView);
mIconsQueue.put(id, task);
task.execute();
}
}
}
}
}
}
示例3: onPostExecute
import com.nextgis.maplib.util.MapUtil; //導入方法依賴的package包/類
@Override
protected void onPostExecute(String result) {
super.onPostExecute(result);
String message;
if (!MapUtil.isParsable(result)) {
try {
JSONObject obj = new JSONObject(result);
Long id = obj.getLong(Constants.JSON_ID_KEY);
if (mLayer != null) {
((NGWVectorLayer) mLayer).setSyncType(Constants.SYNC_DATA);
mLayer.save();
mLayer.toNGW(id, mConnection.getName(), Constants.SYNC_DATA, mVer);
mCounter--;
if (mCounter == 0) {
mProgress.dismiss();
finish();
}
}
result = null;
} catch (JSONException e) {
result = "500";
e.printStackTrace();
}
}
if (result != null) {
switch (result) {
case "-999":
message = getString(R.string.btn_ok);
break;
default:
message = NetworkUtil.getError(mContext, result);
break;
}
Toast.makeText(mContext, message, Toast.LENGTH_LONG).show();
mProgress.dismiss();
}
}