forked from organicmaps/organicmaps
[android] Warning fixes
This commit is contained in:
parent
6101442e92
commit
cdebed8d46
6 changed files with 14 additions and 11 deletions
|
@ -32,6 +32,7 @@ import android.view.ViewGroup;
|
|||
import android.view.ViewStub;
|
||||
import android.view.animation.AlphaAnimation;
|
||||
import android.widget.*;
|
||||
|
||||
import com.facebook.*;
|
||||
import com.facebook.android.R;
|
||||
import com.facebook.model.GraphObject;
|
||||
|
@ -623,6 +624,7 @@ public abstract class PickerFragment<T extends GraphObject> extends Fragment {
|
|||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
private void inflateTitleBar(ViewGroup view) {
|
||||
ViewStub stub = (ViewStub) view.findViewById(R.id.com_facebook_picker_title_bar_stub);
|
||||
if (stub != null) {
|
||||
|
|
|
@ -36,6 +36,7 @@ import android.webkit.WebViewClient;
|
|||
import android.widget.FrameLayout;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
|
||||
import com.facebook.*;
|
||||
import com.facebook.android.*;
|
||||
import com.facebook.internal.Logger;
|
||||
|
@ -333,6 +334,7 @@ public class WebDialog extends Dialog {
|
|||
crossImageView.setVisibility(View.INVISIBLE);
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
@SuppressLint("SetJavaScriptEnabled")
|
||||
private void setUpWebView(int margin) {
|
||||
LinearLayout webViewContainer = new LinearLayout(getContext());
|
||||
|
|
|
@ -21,6 +21,7 @@ import com.mapswithme.util.statistics.Statistics;
|
|||
import java.io.InputStream;
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
import java.util.Scanner;
|
||||
|
||||
public class PromocodeActivationDialog extends Dialog
|
||||
implements OnClickListener, PromoActivationRequest.RequestListener
|
||||
|
@ -45,8 +46,9 @@ public class PromocodeActivationDialog extends Dialog
|
|||
@Override
|
||||
public boolean parseResponse(InputStream is)
|
||||
{
|
||||
final String response = Utils.readStreamAsString(is);
|
||||
return "VALID".equalsIgnoreCase(response);
|
||||
@SuppressWarnings("resource")
|
||||
final Scanner scanner = new Scanner(is).useDelimiter("\\A");
|
||||
return scanner.hasNext() ? "VALID".equalsIgnoreCase(scanner.next()) : false;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -133,6 +133,7 @@ public class SettingsActivity extends PreferenceActivity
|
|||
yotaSetup();
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
private void yotaSetup()
|
||||
{
|
||||
final Preference yopPreference = findPreference(getString(R.string.pref_yota));
|
||||
|
|
|
@ -152,6 +152,8 @@ public class StoragePathActivity extends MapsWithMeBaseListActivity
|
|||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
@SuppressLint("NewApi")
|
||||
private boolean addStorage(String path)
|
||||
{
|
||||
try
|
||||
|
@ -163,7 +165,9 @@ public class StoragePathActivity extends MapsWithMeBaseListActivity
|
|||
return false;
|
||||
|
||||
final StatFs stat = new StatFs(path);
|
||||
final long size = (long)stat.getAvailableBlocks() * (long)stat.getBlockSize();
|
||||
final long size = Utils.apiLowerThan(android.os.Build.VERSION_CODES.JELLY_BEAN_MR2)
|
||||
? (long)stat.getAvailableBlocks() * (long)stat.getBlockSize()
|
||||
: stat.getAvailableBytes();
|
||||
Log.i(TAG, "Available size = " + size);
|
||||
|
||||
final StorageItem item = new StorageItem();
|
||||
|
|
|
@ -2,11 +2,9 @@ package com.mapswithme.util;
|
|||
|
||||
import java.io.Closeable;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.NoSuchElementException;
|
||||
import java.util.Scanner;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.annotation.TargetApi;
|
||||
|
@ -55,12 +53,6 @@ final public class Utils
|
|||
}
|
||||
}
|
||||
|
||||
public static String readStreamAsString(InputStream is)
|
||||
{
|
||||
final Scanner scanner = new Scanner(is).useDelimiter("\\A");
|
||||
return scanner.hasNext() ? scanner.next() : "";
|
||||
}
|
||||
|
||||
public static boolean isAmazonDevice()
|
||||
{
|
||||
return "Amazon".equalsIgnoreCase(Build.MANUFACTURER);
|
||||
|
|
Loading…
Add table
Reference in a new issue