Textview在Android上返回null

Textview在Android上返回null,android,null,textview,Android,Null,Textview,tv1、tv2、tv3、tv4总是为空。我尝试上面的文本视图定义。但没有运行。 我是不是用错了来让自己更平? 运行Lister temizlenemedi错误。 但tv1、2、3、4不起作用。 -这并不是所有的代码- public class MapsActivity extends FragmentActivity implements OnMapReadyCallback{ private GoogleMap myMap; TextView tv1,tv2,tv

tv1、tv2、tv3、tv4总是为空。我尝试上面的文本视图定义。但没有运行。 我是不是用错了来让自己更平? 运行Lister temizlenemedi错误。 但tv1、2、3、4不起作用。 -这并不是所有的代码-

 public class MapsActivity extends FragmentActivity implements OnMapReadyCallback{
      private GoogleMap myMap;
        TextView tv1,tv2,tv3,tv4;
     protected void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.activity_maps);
            getHandleOnMap();
     }
    private void listeyidoldur() {
            try {
                tv1.setText(" ");
                tv2.setText(" ");
                tv3.setText(" ");
                tv4.setText(" ");
            }catch (Exception ex){
                Toast.makeText(getApplicationContext(),"Listeler temizlenemedi",Toast.LENGTH_SHORT).show();
            }
            StrictMode.ThreadPolicy policy=new StrictMode.ThreadPolicy.Builder().permitAll().build();
            StrictMode.setThreadPolicy(policy);

           }
                else{

                   Toast.makeText(getApplicationContext(),"internet bağlantısı gerekli",Toast.LENGTH_SHORT).show();
               }

            }catch (Exception ex){
                Log.e("xml parse hatası" , ex.getMessage().toString());
            }finally {
                if (baglanti!=null){
                baglanti.disconnect();
                 }
            }
            }

        private void getHandleOnMap()
        {
            SupportMapFragment mapFragment = (SupportMapFragment) this.getSupportFragmentManager()
                    .findFragmentById(R.id.map);
            mapFragment.getMapAsync(this);

        }
        @Override
        public void onMapReady(GoogleMap myMap) {
            //maps.....
            myMap.setInfoWindowAdapter(new GoogleMap.InfoWindowAdapter(){


                @Override
                public View getInfoWindow(Marker marker) {
                    View v=getLayoutInflater().inflate(R.layout.infowindows,null);
                    tv1=(TextView)findViewById(R.id.tv1);
                    tv2=(TextView)findViewById(R.id.tv2);
                    tv3=(TextView)findViewById(R.id.tv3);
                    tv4=(TextView)findViewById(R.id.tv4);
                    listeyidoldur();
                    return  v;
                }

                @Override
                public View getInfoContents(Marker marker) {
                    return null;
                }
            });

        }
    }

将初始化更改为如下所示

                @Override
                public View getInfoWindow(Marker marker) {
                    View v=getLayoutInflater().inflate(R.layout.infowindows,null);
                    tv1=(TextView)v.findViewById(R.id.tv1);
                    tv2=(TextView)v.findViewById(R.id.tv2);
                    tv3=(TextView)v.findViewById(R.id.tv3);
                    tv4=(TextView)v.findViewById(R.id.tv4);
                    listeyidoldur();
                    return  v;
                }

将初始化更改为如下所示

                @Override
                public View getInfoWindow(Marker marker) {
                    View v=getLayoutInflater().inflate(R.layout.infowindows,null);
                    tv1=(TextView)v.findViewById(R.id.tv1);
                    tv2=(TextView)v.findViewById(R.id.tv2);
                    tv3=(TextView)v.findViewById(R.id.tv3);
                    tv4=(TextView)v.findViewById(R.id.tv4);
                    listeyidoldur();
                    return  v;
                }