get rid of the other places where Uri's being used but a simple name

is needed.
This commit is contained in:
Andy2 2011-06-05 10:44:26 -07:00
parent c46015c514
commit 84572c1ed6
8 changed files with 10 additions and 24 deletions

View file

@ -35,7 +35,6 @@ import android.content.Intent;
import java.util.concurrent.Semaphore; import java.util.concurrent.Semaphore;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Iterator; import java.util.Iterator;
import android.net.Uri;
import android.app.Dialog; import android.app.Dialog;
import android.app.AlertDialog; import android.app.AlertDialog;
import android.app.ProgressDialog; import android.app.ProgressDialog;
@ -79,7 +78,6 @@ public class BoardActivity extends XWActivity
private Handler m_handler; private Handler m_handler;
private TimerRunnable[] m_timers; private TimerRunnable[] m_timers;
private String m_name; private String m_name;
private Uri m_uri;
private Toolbar m_toolbar; private Toolbar m_toolbar;
private ArrayList<String> m_pendingChats = new ArrayList<String>(); private ArrayList<String> m_pendingChats = new ArrayList<String>();
@ -1221,8 +1219,9 @@ public class BoardActivity extends XWActivity
private void startChatActivity() private void startChatActivity()
{ {
Intent intent = new Intent( Intent.ACTION_EDIT, Intent intent = new Intent( this, ChatActivity.class );
m_uri, this, ChatActivity.class ); intent.setAction( Intent.ACTION_EDIT );
intent.putExtra( BoardActivity.INTENT_KEY_NAME, m_name );
startActivityForResult( intent, CHAT_REQUEST ); startActivityForResult( intent, CHAT_REQUEST );
} }

View file

@ -528,7 +528,8 @@ public class DictsActivity extends ExpandableListActivity
return intent; return intent;
} }
public static void launchAndDownload( Activity activity, int lang, String name ) public static void launchAndDownload( Activity activity, int lang,
String name )
{ {
Intent intent = new Intent( activity, DictsActivity.class ); Intent intent = new Intent( activity, DictsActivity.class );
intent.putExtra( DICT_DOLAUNCH, true ); intent.putExtra( DICT_DOLAUNCH, true );

View file

@ -25,7 +25,6 @@ import android.app.Dialog;
import android.content.DialogInterface; import android.content.DialogInterface;
import android.content.Intent; import android.content.Intent;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.net.Uri;
import junit.framework.Assert; import junit.framework.Assert;
import android.view.View; import android.view.View;
import android.widget.TextView; import android.widget.TextView;

View file

@ -22,7 +22,6 @@ package org.eehouse.android.xw4;
import android.app.Activity; import android.app.Activity;
import android.content.Intent; import android.content.Intent;
import android.net.Uri;
import android.os.Bundle; import android.os.Bundle;
import java.io.File; import java.io.File;
import java.util.ArrayList; import java.util.ArrayList;
@ -373,15 +372,10 @@ public class GameConfig extends XWActivity
m_cp = CommonPrefs.get( this ); m_cp = CommonPrefs.get( this );
Intent intent = getIntent(); Intent intent = getIntent();
Uri uri = intent.getData(); m_path = intent.getStringExtra( BoardActivity.INTENT_KEY_NAME );
m_path = uri.getPath();
if ( m_path.charAt(0) == '/' ) {
m_path = m_path.substring( 1 );
}
setContentView(R.layout.game_config); setContentView(R.layout.game_config);
m_connectSet = findViewById(R.id.connect_set); m_connectSet = findViewById(R.id.connect_set);
m_addPlayerButton = (Button)findViewById(R.id.add_player); m_addPlayerButton = (Button)findViewById(R.id.add_player);
m_addPlayerButton.setOnClickListener( this ); m_addPlayerButton.setOnClickListener( this );

View file

@ -29,7 +29,6 @@ import java.io.FileInputStream;
import java.io.FileOutputStream; import java.io.FileOutputStream;
import java.io.InputStream; import java.io.InputStream;
import java.nio.channels.FileChannel; import java.nio.channels.FileChannel;
import android.net.Uri;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import android.content.res.AssetManager; import android.content.res.AssetManager;
@ -836,8 +835,9 @@ public class GameUtils {
public static void doConfig( Activity activity, String path, Class clazz ) public static void doConfig( Activity activity, String path, Class clazz )
{ {
Uri uri = Uri.fromFile( new File(path) ); Intent intent = new Intent( activity, clazz );
Intent intent = new Intent( Intent.ACTION_EDIT, uri, activity, clazz ); intent.setAction( Intent.ACTION_EDIT );
intent.putExtra( BoardActivity.INTENT_KEY_NAME, path );
activity.startActivity( intent ); activity.startActivity( intent );
} }

View file

@ -28,7 +28,6 @@ import android.app.PendingIntent;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.content.DialogInterface; import android.content.DialogInterface;
import android.net.Uri;
import android.os.Bundle; import android.os.Bundle;
import android.os.Handler; import android.os.Handler;
import android.view.ContextMenu; import android.view.ContextMenu;

View file

@ -28,7 +28,6 @@ package org.eehouse.android.xw4;
import android.app.Activity; import android.app.Activity;
import java.io.File; import java.io.File;
import android.os.Bundle; import android.os.Bundle;
import android.net.Uri;
import android.widget.Button; import android.widget.Button;
import android.widget.TextView; import android.widget.TextView;
import android.view.View; import android.view.View;
@ -54,11 +53,7 @@ public class RelayGameActivity extends XWActivity
setContentView( R.layout.relay_game_config ); setContentView( R.layout.relay_game_config );
Uri uri = getIntent().getData(); m_path = getIntent().getStringExtra( BoardActivity.INTENT_KEY_NAME );
m_path = uri.getPath();
if ( m_path.charAt(0) == '/' ) {
m_path = m_path.substring( 1 );
}
m_playButton = (Button)findViewById( R.id.play_button ); m_playButton = (Button)findViewById( R.id.play_button );
m_playButton.setOnClickListener( this ); m_playButton.setOnClickListener( this );

View file

@ -25,7 +25,6 @@ import android.app.Dialog;
import android.content.Context; import android.content.Context;
import android.content.DialogInterface; import android.content.DialogInterface;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.net.Uri;
import junit.framework.Assert; import junit.framework.Assert;
import android.view.View; import android.view.View;
import android.widget.TextView; import android.widget.TextView;