/* aqui vai o nome do seu pacote */ import android.os.Bundle; import android.support.v4.app.Fragment; import android.text.Html; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.AdapterView; import android.widget.AutoCompleteTextView; import android.widget.TextView; import android.widget.Toast; import com.google.android.gms.common.ConnectionResult; import com.google.android.gms.common.api.GoogleApiClient; import com.google.android.gms.common.api.PendingResult; import com.google.android.gms.common.api.ResultCallback; import com.google.android.gms.location.places.Place; import com.google.android.gms.location.places.PlaceBuffer; import com.google.android.gms.location.places.Places; import com.google.android.gms.maps.model.LatLng; import com.google.android.gms.maps.model.LatLngBounds; public class AutoFragment extends Fragment implements GoogleApiClient.OnConnectionFailedListener, GoogleApiClient.ConnectionCallbacks { private static final int GOOGLE_API_CLIENT_ID = 0; private AutoCompleteTextView mAutocompleteTextView; private TextView mNameTextView; private TextView mAddressTextView; private TextView mIdTextView; private TextView mPhoneTextView; private TextView mWebTextView; private TextView mAttTextView; private GoogleApiClient mGoogleApiClient; private PlaceArrayAdapter mPlaceArrayAdapter; private static final LatLngBounds BOUNDS_MOUNTAIN_VIEW = new LatLngBounds( new LatLng(37.398160, -122.180831), new LatLng(37.430610, -121.972090)); @Override mGoogleApiClient = new GoogleApiClient.Builder(getActivity()) .addApi(Places.GEO_DATA_API) .enableAutoManage(getActivity(), GOOGLE_API_CLIENT_ID, this) .addConnectionCallbacks(this) .build(); mAutocompleteTextView = (AutoCompleteTextView) view.findViewById(R.id .autoCompleteTextView); mAutocompleteTextView.setThreshold(3); mNameTextView = (TextView) view.findViewById(R.id.name); mAddressTextView = (TextView) view.findViewById(R.id.address); mIdTextView = (TextView) view.findViewById(R.id.place_id); mPhoneTextView = (TextView) view.findViewById(R.id.phone); mWebTextView = (TextView) view.findViewById(R.id.web); mAttTextView = (TextView) view.findViewById(R.id.att); mAutocompleteTextView.setOnItemClickListener(mAutocompleteClickListener); mPlaceArrayAdapter = new PlaceArrayAdapter(getActivity(), android.R.layout.simple_list_item_1, BOUNDS_MOUNTAIN_VIEW, null); mAutocompleteTextView.setAdapter(mPlaceArrayAdapter); return view; } private AdapterView.OnItemClickListener mAutocompleteClickListener = new AdapterView.OnItemClickListener() { @Override final PlaceArrayAdapter.PlaceAutocomplete item = mPlaceArrayAdapter.getItem(position); Log.i(LOG_TAG, "Selected: " + item.description); PendingResult<PlaceBuffer> placeResult = Places.GeoDataApi .getPlaceById(mGoogleApiClient, placeId); placeResult.setResultCallback(mUpdatePlaceDetailsCallback); Log.i(LOG_TAG, "Fetching details for ID: " + item.placeId); } }; private ResultCallback<PlaceBuffer> mUpdatePlaceDetailsCallback = new ResultCallback<PlaceBuffer>() { @Override public void onResult(PlaceBuffer places) { if (!places.getStatus().isSuccess()) { Log.e(LOG_TAG, "Place query did not complete. Error: " + places.getStatus().toString()); return; } // Selecting the first object buffer. final Place place = places.get(0); CharSequence attributions = places.getAttributions(); mNameTextView.setText(Html.fromHtml(place.getName() + "")); mAddressTextView.setText(Html.fromHtml(place.getAddress() + "")); mIdTextView.setText(Html.fromHtml(place.getId() + "")); mPhoneTextView.setText(Html.fromHtml(place.getPhoneNumber() + "")); mWebTextView.setText(place.getWebsiteUri() + ""); if (attributions != null) { mAttTextView.setText(Html.fromHtml(attributions.toString())); } } }; @Override public void onConnected(Bundle bundle) { mPlaceArrayAdapter.setGoogleApiClient(mGoogleApiClient); Log.i(LOG_TAG, "Google Places API connected."); } @Override public void onConnectionFailed(ConnectionResult connectionResult) { Log.e(LOG_TAG, "Google Places API connection failed with error code: " + connectionResult.getErrorCode()); Toast.makeText(getActivity(), "Google Places API connection failed with error code:" + connectionResult.getErrorCode(), Toast.LENGTH_LONG).show(); } @Override public void onConnectionSuspended(int i) { mPlaceArrayAdapter.setGoogleApiClient(null); Log.e(LOG_TAG, "Google Places API connection suspended."); } }
Standard input is empty
Main.java:25: error: class AutoFragment is public, should be declared in a file named AutoFragment.java
public class AutoFragment extends Fragment implements
^
Main.java:3: error: package android.os does not exist
import android.os.Bundle;
^
Main.java:4: error: package android.support.v4.app does not exist
import android.support.v4.app.Fragment;
^
Main.java:5: error: package android.text does not exist
import android.text.Html;
^
Main.java:6: error: package android.util does not exist
import android.util.Log;
^
Main.java:7: error: package android.view does not exist
import android.view.LayoutInflater;
^
Main.java:8: error: package android.view does not exist
import android.view.View;
^
Main.java:9: error: package android.view does not exist
import android.view.ViewGroup;
^
Main.java:10: error: package android.widget does not exist
import android.widget.AdapterView;
^
Main.java:11: error: package android.widget does not exist
import android.widget.AutoCompleteTextView;
^
Main.java:12: error: package android.widget does not exist
import android.widget.TextView;
^
Main.java:13: error: package android.widget does not exist
import android.widget.Toast;
^
Main.java:15: error: package com.google.android.gms.common does not exist
import com.google.android.gms.common.ConnectionResult;
^
Main.java:16: error: package com.google.android.gms.common.api does not exist
import com.google.android.gms.common.api.GoogleApiClient;
^
Main.java:17: error: package com.google.android.gms.common.api does not exist
import com.google.android.gms.common.api.PendingResult;
^
Main.java:18: error: package com.google.android.gms.common.api does not exist
import com.google.android.gms.common.api.ResultCallback;
^
Main.java:19: error: package com.google.android.gms.location.places does not exist
import com.google.android.gms.location.places.Place;
^
Main.java:20: error: package com.google.android.gms.location.places does not exist
import com.google.android.gms.location.places.PlaceBuffer;
^
Main.java:21: error: package com.google.android.gms.location.places does not exist
import com.google.android.gms.location.places.Places;
^
Main.java:22: error: package com.google.android.gms.maps.model does not exist
import com.google.android.gms.maps.model.LatLng;
^
Main.java:23: error: package com.google.android.gms.maps.model does not exist
import com.google.android.gms.maps.model.LatLngBounds;
^
Main.java:25: error: cannot find symbol
public class AutoFragment extends Fragment implements
^
symbol: class Fragment
Main.java:26: error: package GoogleApiClient does not exist
GoogleApiClient.OnConnectionFailedListener,
^
Main.java:27: error: package GoogleApiClient does not exist
GoogleApiClient.ConnectionCallbacks {
^
Main.java:30: error: cannot find symbol
private AutoCompleteTextView mAutocompleteTextView;
^
symbol: class AutoCompleteTextView
location: class AutoFragment
Main.java:31: error: cannot find symbol
private TextView mNameTextView;
^
symbol: class TextView
location: class AutoFragment
Main.java:32: error: cannot find symbol
private TextView mAddressTextView;
^
symbol: class TextView
location: class AutoFragment
Main.java:33: error: cannot find symbol
private TextView mIdTextView;
^
symbol: class TextView
location: class AutoFragment
Main.java:34: error: cannot find symbol
private TextView mPhoneTextView;
^
symbol: class TextView
location: class AutoFragment
Main.java:35: error: cannot find symbol
private TextView mWebTextView;
^
symbol: class TextView
location: class AutoFragment
Main.java:36: error: cannot find symbol
private TextView mAttTextView;
^
symbol: class TextView
location: class AutoFragment
Main.java:37: error: cannot find symbol
private GoogleApiClient mGoogleApiClient;
^
symbol: class GoogleApiClient
location: class AutoFragment
Main.java:38: error: cannot find symbol
private PlaceArrayAdapter mPlaceArrayAdapter;
^
symbol: class PlaceArrayAdapter
location: class AutoFragment
Main.java:39: error: cannot find symbol
private static final LatLngBounds BOUNDS_MOUNTAIN_VIEW = new LatLngBounds(
^
symbol: class LatLngBounds
location: class AutoFragment
Main.java:43: error: cannot find symbol
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
^
symbol: class LayoutInflater
location: class AutoFragment
Main.java:43: error: cannot find symbol
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
^
symbol: class ViewGroup
location: class AutoFragment
Main.java:43: error: cannot find symbol
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
^
symbol: class Bundle
location: class AutoFragment
Main.java:43: error: cannot find symbol
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
^
symbol: class View
location: class AutoFragment
Main.java:68: error: package AdapterView does not exist
private AdapterView.OnItemClickListener mAutocompleteClickListener
^
Main.java:82: error: cannot find symbol
private ResultCallback<PlaceBuffer> mUpdatePlaceDetailsCallback
^
symbol: class ResultCallback
location: class AutoFragment
Main.java:82: error: cannot find symbol
private ResultCallback<PlaceBuffer> mUpdatePlaceDetailsCallback
^
symbol: class PlaceBuffer
location: class AutoFragment
Main.java:107: error: cannot find symbol
public void onConnected(Bundle bundle) {
^
symbol: class Bundle
location: class AutoFragment
Main.java:114: error: cannot find symbol
public void onConnectionFailed(ConnectionResult connectionResult) {
^
symbol: class ConnectionResult
location: class AutoFragment
Main.java:39: error: cannot find symbol
private static final LatLngBounds BOUNDS_MOUNTAIN_VIEW = new LatLngBounds(
^
symbol: class LatLngBounds
location: class AutoFragment
Main.java:40: error: cannot find symbol
new LatLng(37.398160, -122.180831), new LatLng(37.430610, -121.972090));
^
symbol: class LatLng
location: class AutoFragment
Main.java:40: error: cannot find symbol
new LatLng(37.398160, -122.180831), new LatLng(37.430610, -121.972090));
^
symbol: class LatLng
location: class AutoFragment
Main.java:42: error: method does not override or implement a method from a supertype
@Override
^
Main.java:44: error: cannot find symbol
View view = inflater.inflate(R.layout.layout_fragment, container);
^
symbol: class View
location: class AutoFragment
Main.java:44: error: package R does not exist
View view = inflater.inflate(R.layout.layout_fragment, container);
^
Main.java:48: error: cannot find symbol
.enableAutoManage(getActivity(), GOOGLE_API_CLIENT_ID, this)
^
symbol: method getActivity()
location: class AutoFragment
Main.java:47: error: cannot find symbol
.addApi(Places.GEO_DATA_API)
^
symbol: variable Places
location: class AutoFragment
Main.java:46: error: package GoogleApiClient does not exist
mGoogleApiClient = new GoogleApiClient.Builder(getActivity())
^
Main.java:46: error: cannot find symbol
mGoogleApiClient = new GoogleApiClient.Builder(getActivity())
^
symbol: method getActivity()
location: class AutoFragment
Main.java:51: error: cannot find symbol
mAutocompleteTextView = (AutoCompleteTextView) view.findViewById(R.id
^
symbol: class AutoCompleteTextView
location: class AutoFragment
Main.java:51: error: package R does not exist
mAutocompleteTextView = (AutoCompleteTextView) view.findViewById(R.id
^
Main.java:54: error: cannot find symbol
mNameTextView = (TextView) view.findViewById(R.id.name);
^
symbol: class TextView
location: class AutoFragment
Main.java:54: error: package R does not exist
mNameTextView = (TextView) view.findViewById(R.id.name);
^
Main.java:55: error: cannot find symbol
mAddressTextView = (TextView) view.findViewById(R.id.address);
^
symbol: class TextView
location: class AutoFragment
Main.java:55: error: package R does not exist
mAddressTextView = (TextView) view.findViewById(R.id.address);
^
Main.java:56: error: cannot find symbol
mIdTextView = (TextView) view.findViewById(R.id.place_id);
^
symbol: class TextView
location: class AutoFragment
Main.java:56: error: package R does not exist
mIdTextView = (TextView) view.findViewById(R.id.place_id);
^
Main.java:57: error: cannot find symbol
mPhoneTextView = (TextView) view.findViewById(R.id.phone);
^
symbol: class TextView
location: class AutoFragment
Main.java:57: error: package R does not exist
mPhoneTextView = (TextView) view.findViewById(R.id.phone);
^
Main.java:58: error: cannot find symbol
mWebTextView = (TextView) view.findViewById(R.id.web);
^
symbol: class TextView
location: class AutoFragment
Main.java:58: error: package R does not exist
mWebTextView = (TextView) view.findViewById(R.id.web);
^
Main.java:59: error: cannot find symbol
mAttTextView = (TextView) view.findViewById(R.id.att);
^
symbol: class TextView
location: class AutoFragment
Main.java:59: error: package R does not exist
mAttTextView = (TextView) view.findViewById(R.id.att);
^
Main.java:61: error: cannot find symbol
mPlaceArrayAdapter = new PlaceArrayAdapter(getActivity(), android.R.layout.simple_list_item_1,
^
symbol: class PlaceArrayAdapter
location: class AutoFragment
Main.java:61: error: cannot find symbol
mPlaceArrayAdapter = new PlaceArrayAdapter(getActivity(), android.R.layout.simple_list_item_1,
^
symbol: method getActivity()
location: class AutoFragment
Main.java:61: error: package android.R does not exist
mPlaceArrayAdapter = new PlaceArrayAdapter(getActivity(), android.R.layout.simple_list_item_1,
^
Main.java:69: error: package AdapterView does not exist
= new AdapterView.OnItemClickListener() {
^
Main.java:83: error: cannot find symbol
= new ResultCallback<PlaceBuffer>() {
^
symbol: class ResultCallback
location: class AutoFragment
Main.java:83: error: cannot find symbol
= new ResultCallback<PlaceBuffer>() {
^
symbol: class PlaceBuffer
location: class AutoFragment
Main.java:106: error: method does not override or implement a method from a supertype
@Override
^
Main.java:109: error: cannot find symbol
Log.i(LOG_TAG, "Google Places API connected.");
^
symbol: variable Log
location: class AutoFragment
Main.java:113: error: method does not override or implement a method from a supertype
@Override
^
Main.java:115: error: cannot find symbol
Log.e(LOG_TAG, "Google Places API connection failed with error code: "
^
symbol: variable Log
location: class AutoFragment
Main.java:118: error: cannot find symbol
Toast.makeText(getActivity(),
^
symbol: method getActivity()
location: class AutoFragment
Main.java:121: error: cannot find symbol
Toast.LENGTH_LONG).show();
^
symbol: variable Toast
location: class AutoFragment
Main.java:118: error: cannot find symbol
Toast.makeText(getActivity(),
^
symbol: variable Toast
location: class AutoFragment
Main.java:124: error: method does not override or implement a method from a supertype
@Override
^
Main.java:127: error: cannot find symbol
Log.e(LOG_TAG, "Google Places API connection suspended.");
^
symbol: variable Log
location: class AutoFragment
82 errors
Standard output is empty