나는 (학습) 테스트 응용 프로그램을 개발하고 있어요는공유 텍스트 만 안드로이드 스튜디오
위치 코드 ... 등을 이메일을 통해 공유 할 수 매우 잘 작동하지만 전자 메일 인터페이스가 호출되면 다음과 같이 많은 코드가 함께 제공됩니다.
"Android.widget.TextView {f05b211V.ED .... ..ID 48,108-1032, 165 # 7f0d0053 applied/tv_coordinate} "
어떻게 해결할 수 있습니까? 올바른 값 (위도와 경도, 경우) 만 표시됩니까?
감사합니다.
public class MainActivity extends ActionBarActivity
implements GoogleApiClient.ConnectionCallbacks,
GoogleApiClient.OnConnectionFailedListener {
private TextView tvCoordinate;
private GoogleApiClient mGoogleApiClient;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
tvCoordinate = (TextView) findViewById(R.id.tv_coordinate);
callConnection();
}
private synchronized void callConnection() {
mGoogleApiClient = new GoogleApiClient.Builder(this)
.addOnConnectionFailedListener(this)
.addConnectionCallbacks(this)
.addApi(LocationServices.API)
.build();
mGoogleApiClient.connect();
}
String msg4;
@Override
public void onConnected(Bundle bundle) {
TextView resultado = (TextView) findViewById(R.id.result);
Log.i("LOG", "onConnected(" + bundle + ")");
Location l = LocationServices
.FusedLocationApi
.getLastLocation(mGoogleApiClient);
if (l != null) {
Log.i("LOG", "latitude: " + l.getLatitude());
Log.i("LOG", "longitude: " + l.getLongitude());
tvCoordinate.setText(l.getLatitude() + " | " + l.getLongitude());
msg4 = String.format("%s", tvCoordinate);
resultado.setText(msg4);
}
}
@Override
public void onConnectionSuspended(int i) {
Log.i("LOG", "onConnectionSuspended(" + i + ")");
}
@Override
public void onConnectionFailed(ConnectionResult connectionResult) {
Log.i("LOG", "onConnectionFailed(" + connectionResult + ")");
}
public void enviardados(View view) {
Intent sharingIntent = new Intent(android.content.Intent.ACTION_SEND);
sharingIntent.setType("text/plain");
String shareBody = String.format("A localizacao e %s", msg4);
sharingIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, "Localizacao");
sharingIntent.putExtra(android.content.Intent.EXTRA_TEXT, shareBody);
startActivity(Intent.createChooser(sharingIntent, "Compartilhar via"));
}
}
* 이해 할 수없는 나는 *와 함께 오는 많은 코드가있다. Pls 정교. – Raghunandan