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