mirror of
https://codeberg.org/OpenTracksApp/OpenTracks.git
synced 2026-10-02 09:33:06 +02:00
fix various eclipse warnings
This commit is contained in:
@@ -147,7 +147,7 @@ public class ImportActivity extends Activity {
|
||||
Intent intent = IntentUtils
|
||||
.newIntent(ImportActivity.this, TrackDetailActivity.class)
|
||||
.putExtra(TrackDetailActivity.EXTRA_TRACK_ID, trackId);
|
||||
TaskStackBuilder taskStackBuilder = TaskStackBuilder.from(ImportActivity.this);
|
||||
TaskStackBuilder taskStackBuilder = TaskStackBuilder.create(ImportActivity.this);
|
||||
taskStackBuilder.addNextIntent(intent);
|
||||
taskStackBuilder.startActivities();
|
||||
}
|
||||
|
||||
+4
-4
@@ -66,12 +66,12 @@ public class DeleteOneTrackDialogFragment extends DialogFragment {
|
||||
private DeleteOneTrackCaller caller;
|
||||
|
||||
@Override
|
||||
public void onAttach(Activity activity) {
|
||||
super.onAttach(activity);
|
||||
public void onAttach(Activity anActivity) {
|
||||
super.onAttach(anActivity);
|
||||
try {
|
||||
caller = (DeleteOneTrackCaller) activity;
|
||||
caller = (DeleteOneTrackCaller) anActivity;
|
||||
} catch (ClassCastException e) {
|
||||
throw new ClassCastException(activity.toString() + " must implement DeleteOneTrackCaller");
|
||||
throw new ClassCastException(anActivity.toString() + " must implement DeleteOneTrackCaller");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -112,7 +112,8 @@ public class SendDocsUtils {
|
||||
throws IOException, ParseException, HttpException {
|
||||
GDataParser gDataParser = null;
|
||||
try {
|
||||
String uri = String.format(Locale.US, GET_SPREADSHEET_BY_TITLE_URI, URLEncoder.encode(title));
|
||||
String uri = String.format(
|
||||
Locale.US, GET_SPREADSHEET_BY_TITLE_URI, URLEncoder.encode(title, "UTF-8"));
|
||||
gDataParser = documentsClient.getParserForFeed(Entry.class, uri, authToken);
|
||||
gDataParser.init();
|
||||
|
||||
|
||||
+8
-1
@@ -39,6 +39,7 @@ import android.util.Log;
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -397,7 +398,13 @@ public class SendFusionTablesAsyncTask extends AbstractSendAsyncTask {
|
||||
}
|
||||
|
||||
GenericUrl url = new GenericUrl(FUSION_TABLES_BASE_URL);
|
||||
String sql = SQL_KEY + URLEncoder.encode(query);
|
||||
String sql;
|
||||
try {
|
||||
sql = SQL_KEY + URLEncoder.encode(query, "UTF-8");
|
||||
} catch (UnsupportedEncodingException e1) {
|
||||
Log.d(TAG, "Unable to encode query", e1);
|
||||
return false;
|
||||
}
|
||||
ByteArrayInputStream inputStream = new ByteArrayInputStream(Strings.toBytesUtf8(sql));
|
||||
InputStreamContent inputStreamContent = new InputStreamContent(null, inputStream);
|
||||
HttpRequest request;
|
||||
|
||||
@@ -139,14 +139,12 @@ public class AndroidGDataClient implements GDataClient {
|
||||
* @see GDataClient#encodeUri(java.lang.String)
|
||||
*/
|
||||
public String encodeUri(String uri) {
|
||||
String encodedUri;
|
||||
String encodedUri = null;
|
||||
try {
|
||||
encodedUri = URLEncoder.encode(uri, "UTF-8");
|
||||
} catch (UnsupportedEncodingException uee) {
|
||||
// should not happen.
|
||||
Log.e("JakartaGDataClient", "UTF-8 not supported -- should not happen. "
|
||||
+ "Using default encoding.", uee);
|
||||
encodedUri = URLEncoder.encode(uri);
|
||||
// Should not happen
|
||||
throw new IllegalStateException("Cannot encode " + uri, uee);
|
||||
}
|
||||
return encodedUri;
|
||||
}
|
||||
|
||||
@@ -18,7 +18,6 @@ package com.google.android.apps.mytracks.io.gdata;
|
||||
import com.google.wireless.gdata.client.QueryParams;
|
||||
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLEncoder;
|
||||
@@ -81,10 +80,8 @@ public class QueryParamsImpl extends QueryParams {
|
||||
try {
|
||||
encodedValue = URLEncoder.encode(value, "UTF-8");
|
||||
} catch (UnsupportedEncodingException uee) {
|
||||
// should not happen.
|
||||
Log.w("QueryParamsImpl", "UTF-8 not supported -- should not happen. "
|
||||
+ "Using default encoding.", uee);
|
||||
encodedValue = URLEncoder.encode(value);
|
||||
// Should not happen
|
||||
throw new IllegalStateException("Cannot encode " + value, uee);
|
||||
}
|
||||
sb.append(encodedValue);
|
||||
}
|
||||
|
||||
@@ -41,7 +41,6 @@ public class TrackPathUtils {
|
||||
* @param color the path color
|
||||
* @param append true to append to the last path
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public static void addPath(GoogleMap googleMap, ArrayList<Polyline> paths,
|
||||
ArrayList<LatLng> points, int color, boolean append) {
|
||||
if (points.size() == 0) {
|
||||
|
||||
@@ -1018,7 +1018,7 @@ public class TrackRecordingService extends Service {
|
||||
if (isRecording() && !isPaused()) {
|
||||
Intent intent = IntentUtils.newIntent(this, TrackDetailActivity.class)
|
||||
.putExtra(TrackDetailActivity.EXTRA_TRACK_ID, recordingTrackId);
|
||||
TaskStackBuilder taskStackBuilder = TaskStackBuilder.from(this);
|
||||
TaskStackBuilder taskStackBuilder = TaskStackBuilder.create(this);
|
||||
taskStackBuilder.addNextIntent(intent);
|
||||
|
||||
NotificationCompat.Builder builder = new NotificationCompat.Builder(this).setContentIntent(
|
||||
@@ -1026,7 +1026,7 @@ public class TrackRecordingService extends Service {
|
||||
.setContentText(getString(R.string.track_record_notification))
|
||||
.setContentTitle(getString(R.string.my_tracks_app_name)).setOngoing(true)
|
||||
.setSmallIcon(R.drawable.my_tracks_notification_icon).setWhen(System.currentTimeMillis());
|
||||
startForegroundService(builder.getNotification());
|
||||
startForegroundService(builder.build());
|
||||
} else {
|
||||
stopForegroundService();
|
||||
}
|
||||
|
||||
@@ -264,7 +264,7 @@ public class TrackWidgetProvider extends AppWidgetProvider {
|
||||
} else {
|
||||
intent = IntentUtils.newIntent(context, TrackListActivity.class);
|
||||
}
|
||||
TaskStackBuilder taskStackBuilder = TaskStackBuilder.from(context);
|
||||
TaskStackBuilder taskStackBuilder = TaskStackBuilder.create(context);
|
||||
taskStackBuilder.addNextIntent(intent);
|
||||
PendingIntent pendingIntent = taskStackBuilder.getPendingIntent(0, 0);
|
||||
remoteViews.setOnClickPendingIntent(R.id.track_widget_stats_container, pendingIntent);
|
||||
|
||||
@@ -25,7 +25,7 @@ limitations under the License.
|
||||
for details on what should go here vs in the application project.
|
||||
-->
|
||||
<uses-sdk
|
||||
android:minSdkVersion="7"
|
||||
android:minSdkVersion="8"
|
||||
android:targetSdkVersion="16" />
|
||||
|
||||
<application
|
||||
|
||||
@@ -28,7 +28,7 @@ limitations under the License.
|
||||
android:targetPackage="com.google.android.maps.mytracks" />
|
||||
|
||||
<uses-sdk
|
||||
android:minSdkVersion="7"
|
||||
android:minSdkVersion="8"
|
||||
android:targetSdkVersion="16" />
|
||||
|
||||
<application
|
||||
|
||||
Reference in New Issue
Block a user