2016-08-02 9 views
-1

私のアプリにlistviewを追加しました...私がlistviewのmarshmallowバージョンのモバイルをクリックした場合..私のアプリがぶら下がっています...しかし、他のバージョンの作業good..Iは私のapp..can誰に問題が私logcatでandroidのリストビューのonclickを

  public class ConfigureFragment extends Fragment { 
        } 

     public class DeviceListAdapter extends BaseExpandableListAdapter { 
     ArrayList<String> accessPoints; 
     ArrayList<String> groupTitle; 
     ArrayList<String> securityType; 

     public DeviceListAdapter() { 
      accessPoints = new ArrayList<String>(); 
      groupTitle = new ArrayList<String>(); 
      groupTitle.add("apps"); 
     } 

     public void setAccessPoints(ArrayList<String> aPs, ArrayList<String> sType) { 
      accessPoints = new ArrayList<String>(aPs); 
      securityType = new ArrayList<String>(sType); 
     } 

     @Override 
     public int getGroupCount() { 
      return 1; 
     } 

     @Override 
     public int getChildrenCount(int groupPosition) { 
      return accessPoints.size(); 
     } 

     @Override 
     public Object getGroup(int groupPosition) { 
      return null; 
     } 

     @Override 
     public Object getChild(int groupPosition, int childPosition) { 
      return null; 
     } 

     @Override 
     public long getGroupId(int groupPosition) { 
      return 0; 
     } 

     @Override 
     public long getChildId(int groupPosition, int childPosition) { 
      return 0; 
     } 

     @Override 
     public boolean hasStableIds() { 
      return false; 
     } 


     @Override 
     public View getChildView(int gi, int ci, boolean isLastChild, View view, final ViewGroup parent) { 
      LayoutInflater inflater = (LayoutInflater) getActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE); 
      view = inflater.inflate(R.layout.single_item, null); 
      final TextView textView = (TextView) view.findViewById(R.id.apName); 
      textView.setText(accessPoints.get(ci)); 
      textView.setOnClickListener(new View.OnClickListener() { 
       @Override 
       public void onClick(View view) { 
        final Dialog dialog = new Dialog(getActivity()); 
        dialog.requestWindowFeature(Window.FEATURE_NO_TITLE); 
        Window window = dialog.getWindow(); 
        WindowManager.LayoutParams wlp = window.getAttributes(); 
        window.setAttributes(wlp); 
        dialog.setContentView(R.layout.confirm_dialog_layout); 
        Button yes = (Button) dialog.findViewById(R.id.yesButton); 
        Button no = (Button) dialog.findViewById(R.id.noButton); 

        TextView message = (TextView) dialog.findViewById(R.id.confirmMessage); 

        yes.setOnClickListener(new View.OnClickListener() { 
         @Override 
         public void onClick(View view) { 
          String ssid = (String) textView.getText(); 
          WifiConfiguration conf = new WifiConfiguration(); 
          conf.SSID = "\"" + ssid + "\""; 
          List<WifiConfiguration> list = wifiManager.getConfiguredNetworks(); 
          for(WifiConfiguration i : list) { 
           if(i.SSID != null && i.SSID.equals("\"" + ssid + "\"")) { 
            wifiManager.disconnect(); 
            wifiManager.enableNetwork(i.networkId, true); 
            wifiManager.reconnect(); 
            break; 
           } 
          } 

         ExpandableListView expandableListView = (ExpandableListView) parent; 
         groupTitle.remove(0); 
         groupTitle.add(ssid); 
         expandableListView.collapseGroup(0); 
         dialog.dismiss(); 
        } 
       }); 
       no.setOnClickListener(new View.OnClickListener() { 
        @Override 
        public void onClick(View view) { 
         dialog.dismiss(); 
        } 
       }); 
       dialog.setCanceledOnTouchOutside(true); 
       dialog.show(); 
      } 
     }); 
     return view; 
    } 

がエラー

> E/NEW_BHD: Battery Power Supply logging Daemon start!!!!! E/NEW_BHD: 
> Cannot run on production devices! 
> I/NetworkController.MotorolaMobileSignalController(1): 
> MotorolaMobilePhoneStateListener.onSignalStrengthsChanged: Entered: 
> signalStrength=SignalStrength: 31 0 -120 -160 -120 -1 -1 99 2147483647 
> 2147483647 2147483647 2147483647 2147483647 gsm|lte level=4 
> 
> I/InputDispatcher: Dropped event because it is stale. 
> I/InputDispatcher: Dropped event because it is stale. E/NEW_BHD: 
> Battery Power Supply logging Daemon start!!!!! E/NEW_BHD: Cannot run 
> on production devices! 
> 
> 
> I/InputDispatcher: Application is not responding: Window{6a1a2b5 u0 
> com.abcd.Main/com.abcd.main.MainActivity}. It has been 9573.9ms 
> since event, 5001.1ms since wait started. Reason: Waiting to send 
> non-key event because the touched window has not finished processing 
> certain input events that were delivered to it over 500.0ms ago. 
> Wait queue length: 3. Wait queue head age: 30816.1ms. 
> 
> I/SFPerfTracer:  triggers: (rate: 0:199) (67991 sw vsyncs) (0 
> skipped) (516:666786 vsyncs) (518:778125) W/System.err: 
> java.net.SocketTimeoutException W/System.err:  at  
> libcore.io.IoBridge.maybeThrowAfterRecvfrom(IoBridge.java:594) 0 
> W/System.err:  at libcore.io.IoBridge.recvfrom(IoBridge.java:552) 
> W/System.err:  at 
> java.net.PlainDatagramSocketImpl.doRecv(PlainDatagramSocketImpl.java:163) 
> W/System.err:  at 
> java.net.PlainDatagramSocketImpl.receive(PlainDatagramSocketImpl.java:171) 
> W/System.err:  at 
> java.net.DatagramSocket.receive(DatagramSocket.java:274) W/System.err: 
> at com.abcd.manager.Manager$tOp$5.run(Manager.java:1542) W/System.err: 
> at java.lang.Thread.run(Thread.java:818) W/System.err: Caused by: 
> android.system.ErrnoException: recvfrom failed: EAGAIN (Try again) 
> W/System.err:  at libcore.io.Posix.recvfromBytes(Native Method) 
> W/System.err:  at libcore.io.Posix.recvfrom(Posix.java:189) 
> W/System.err:  at 
> libcore.io.BlockGuardOs.recvfrom(BlockGuardOs.java:250) W/System.err: 
> at libcore.io.IoBridge.recvfrom(IoBridge.java:549) W/System.err: ... 
> 5 more E/NEW_BHD: Battery Power Supply logging Daemon start!!!!! 
> E/NEW_BHD: Cannot run on production devices! I/InputDispatcher: 
> Dropped event because it is stale. I/InputDispatcher: Dropped event 
> because it is stale. 
+0

しようとするあなたの許可を変更! –

+0

@rakeshはkitkatでうまく動作していますか? –

+0

はいbro ..すべてのバージョンがうまく動作しています...マシュマロ以外...上記のエラーは私がマシュマロバージョンのlogcatです。 – rakesh

答えて

0

あなたはruntime permissionを取得する必要が助けていただきました!知っているDON''Tユーザーからandroid 6.0 and greeter私のearlier answerを参照して、ユーザーからランタイム許可を得る方法を参照してください。

注: RecyclerViewを使用してandroid.permission.READ_PHONE_STATE

関連する問題