Autore Topic: aggiornamento a 2.3.3 ... app si riempie di errori  (Letto 347 volte)

Offline gfx

  • Nuovo arrivato
  • *
  • Post: 29
  • Respect: 0
    • Mostra profilo
  • Dispositivo Android:
    galaxy
  • Sistema operativo:
    ubuntu 14.04
aggiornamento a 2.3.3 ... app si riempie di errori
« il: 17 Giugno 2017, 00:36:42 CEST »
0
come da titolo.. ho aggiornato AS a 2.3.3 su ubuntu ... era qualche mese che non toccavo la mia app ...volevo inserire un test per il voice command ... così fiducioso ho aggiornato e ho cominciato ad inserire codice ... poi faccio un primo debug ... e noto gli errori ... sistemo due cose su AS e poi debug di nuovo ancora errori ... quindi tolgo il nuovo codice ... ma gli errori rimangono .. sotto il  logcat ... più sotto l'activity incrimunata ... non capisco a cosa si riferisce l'errore ... non sono affatto ferrato su java.


Codice: [Seleziona]
06-17 00:27:16.502 4354-4354/? E/Zygote: v2
06-17 00:27:16.502 4354-4354/? W/SELinux: Function: selinux_compare_spd_ram, index[1], priority [2], priority version is VE=SEPF_SECMOBILE_6.0.1_0030
06-17 00:27:16.512 4354-4354/? E/Zygote: accessInfo : 0
06-17 00:27:16.512 4354-4354/? W/SELinux: SELinux: seapp_context_lookup: seinfo=default, level=s0:c512,c768, pkgname=com.example.jo.androidkc1
06-17 00:27:16.582 4354-4354/com.example.jo.androidkc1 W/ResourcesManager: getTopLevelResources: /data/app/com.example.jo.androidkc1-2/base.apk / 1.0 running in com.example.jo.androidkc1 rsrc of package null
06-17 00:27:16.592 4354-4354/com.example.jo.androidkc1 W/ActivityThread: Application com.example.jo.androidkc1 is waiting for the debugger on port 8100...
06-17 00:27:18.282 4354-4354/com.example.jo.androidkc1 W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg  --debuggable --instruction-set=arm --instruction-set-features=smp,div,atomic_ldrd_strd --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --instruction-set-variant=krait --instruction-set-features=default --dex-file=/data/app/com.example.jo.androidkc1-2/split_lib_dependencies_apk.apk --oat-file=/data/dalvik-cache/arm/data@app@com.example.jo.androidkc1-2@split_lib_dependencies_apk.apk@classes.dex) because non-0 exit status
06-17 00:27:18.572 4354-4354/com.example.jo.androidkc1 W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg  --debuggable --instruction-set=arm --instruction-set-features=smp,div,atomic_ldrd_strd --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --instruction-set-variant=krait --instruction-set-features=default --dex-file=/data/app/com.example.jo.androidkc1-2/split_lib_slice_0_apk.apk --oat-file=/data/dalvik-cache/arm/data@app@com.example.jo.androidkc1-2@split_lib_slice_0_apk.apk@classes.dex) because non-0 exit status
06-17 00:27:18.632 4354-4354/com.example.jo.androidkc1 W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg  --debuggable --instruction-set=arm --instruction-set-features=smp,div,atomic_ldrd_strd --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --instruction-set-variant=krait --instruction-set-features=default --dex-file=/data/app/com.example.jo.androidkc1-2/split_lib_slice_1_apk.apk --oat-file=/data/dalvik-cache/arm/data@app@com.example.jo.androidkc1-2@split_lib_slice_1_apk.apk@classes.dex) because non-0 exit status
06-17 00:27:18.682 4354-4354/com.example.jo.androidkc1 W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg  --debuggable --instruction-set=arm --instruction-set-features=smp,div,atomic_ldrd_strd --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --instruction-set-variant=krait --instruction-set-features=default --dex-file=/data/app/com.example.jo.androidkc1-2/split_lib_slice_2_apk.apk --oat-file=/data/dalvik-cache/arm/data@app@com.example.jo.androidkc1-2@split_lib_slice_2_apk.apk@classes.dex) because non-0 exit status
06-17 00:27:18.742 4354-4354/com.example.jo.androidkc1 W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg  --debuggable --instruction-set=arm --instruction-set-features=smp,div,atomic_ldrd_strd --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --instruction-set-variant=krait --instruction-set-features=default --dex-file=/data/app/com.example.jo.androidkc1-2/split_lib_slice_3_apk.apk --oat-file=/data/dalvik-cache/arm/data@app@com.example.jo.androidkc1-2@split_lib_slice_3_apk.apk@classes.dex) because non-0 exit status
06-17 00:27:18.792 4354-4354/com.example.jo.androidkc1 W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg  --debuggable --instruction-set=arm --instruction-set-features=smp,div,atomic_ldrd_strd --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --instruction-set-variant=krait --instruction-set-features=default --dex-file=/data/app/com.example.jo.androidkc1-2/split_lib_slice_4_apk.apk --oat-file=/data/dalvik-cache/arm/data@app@com.example.jo.androidkc1-2@split_lib_slice_4_apk.apk@classes.dex) because non-0 exit status
06-17 00:27:18.852 4354-4354/com.example.jo.androidkc1 W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg  --debuggable --instruction-set=arm --instruction-set-features=smp,div,atomic_ldrd_strd --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --instruction-set-variant=krait --instruction-set-features=default --dex-file=/data/app/com.example.jo.androidkc1-2/split_lib_slice_5_apk.apk --oat-file=/data/dalvik-cache/arm/data@app@com.example.jo.androidkc1-2@split_lib_slice_5_apk.apk@classes.dex) because non-0 exit status
06-17 00:27:18.912 4354-4354/com.example.jo.androidkc1 W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg  --debuggable --instruction-set=arm --instruction-set-features=smp,div,atomic_ldrd_strd --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --instruction-set-variant=krait --instruction-set-features=default --dex-file=/data/app/com.example.jo.androidkc1-2/split_lib_slice_6_apk.apk --oat-file=/data/dalvik-cache/arm/data@app@com.example.jo.androidkc1-2@split_lib_slice_6_apk.apk@classes.dex) because non-0 exit status
06-17 00:27:18.972 4354-4354/com.example.jo.androidkc1 W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg  --debuggable --instruction-set=arm --instruction-set-features=smp,div,atomic_ldrd_strd --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --instruction-set-variant=krait --instruction-set-features=default --dex-file=/data/app/com.example.jo.androidkc1-2/split_lib_slice_7_apk.apk --oat-file=/data/dalvik-cache/arm/data@app@com.example.jo.androidkc1-2@split_lib_slice_7_apk.apk@classes.dex) because non-0 exit status
06-17 00:27:19.032 4354-4354/com.example.jo.androidkc1 W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg  --debuggable --instruction-set=arm --instruction-set-features=smp,div,atomic_ldrd_strd --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --instruction-set-variant=krait --instruction-set-features=default --dex-file=/data/app/com.example.jo.androidkc1-2/split_lib_slice_8_apk.apk --oat-file=/data/dalvik-cache/arm/data@app@com.example.jo.androidkc1-2@split_lib_slice_8_apk.apk@classes.dex) because non-0 exit status
06-17 00:27:19.092 4354-4354/com.example.jo.androidkc1 W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg  --debuggable --instruction-set=arm --instruction-set-features=smp,div,atomic_ldrd_strd --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --instruction-set-variant=krait --instruction-set-features=default --dex-file=/data/app/com.example.jo.androidkc1-2/split_lib_slice_9_apk.apk --oat-file=/data/dalvik-cache/arm/data@app@com.example.jo.androidkc1-2@split_lib_slice_9_apk.apk@classes.dex) because non-0 exit status
06-17 00:27:19.102 4354-4354/com.example.jo.androidkc1 W/System: ClassLoader referenced unknown path: /data/app/com.example.jo.androidkc1-2/lib/arm
06-17 00:27:19.412 4354-4354/com.example.jo.androidkc1 W/art: Verification of void com.example.jo.androidkc1.FullscreenActivity.<init>() took 257.990ms
06-17 00:27:19.612 4354-4354/com.example.jo.androidkc1 W/ResourcesManager: getTopLevelResources: /data/app/com.example.jo.androidkc1-2/base.apk / 1.0 running in com.example.jo.androidkc1 rsrc of package null
06-17 00:27:19.612 4354-4354/com.example.jo.androidkc1 W/ResourcesManager: getTopLevelResources: /data/app/com.example.jo.androidkc1-2/base.apk / 1.0 running in com.example.jo.androidkc1 rsrc of package null
06-17 00:27:19.752 4354-4354/com.example.jo.androidkc1 W/art: Before Android 4.1, method android.graphics.PorterDuffColorFilter android.support.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable
[color=red]06-17 00:27:19.932 4354-4354/com.example.jo.androidkc1 E/AndroidRuntime: FATAL EXCEPTION: main
                                                                                  Process: com.example.jo.androidkc1, PID: 4354
                                                                                  java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.jo.androidkc1/com.example.jo.androidkc1.FullscreenActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void com.google.android.gms.common.api.GoogleApiClient.connect()' on a null object reference
                                                                                      at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3253)
                                                                                      at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3349)
                                                                                      at android.app.ActivityThread.access$1100(ActivityThread.java:221)
                                                                                      at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1794)
                                                                                      at android.os.Handler.dispatchMessage(Handler.java:102)
                                                                                      at android.os.Looper.loop(Looper.java:158)
                                                                                      at android.app.ActivityThread.main(ActivityThread.java:7224)
                                                                                      at java.lang.reflect.Method.invoke(Native Method)
                                                                                      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
                                                                                      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
                                                                                   Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void com.google.android.gms.common.api.GoogleApiClient.connect()' on a null object reference
                                                                                      at com.example.jo.androidkc1.FullscreenActivity.onStart(FullscreenActivity.java:928)
                                                                                      at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1265)
                                                                                      at android.app.Activity.performStart(Activity.java:6915)
                                                                                      at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3216)
                                                                                      at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3349)
                                                                                      at android.app.ActivityThread.access$1100(ActivityThread.java:221)
                                                                                      at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1794)
                                                                                      at android.os.Handler.dispatchMessage(Handler.java:102)
                                                                                      at android.os.Looper.loop(Looper.java:158)
                                                                                      at android.app.ActivityThread.main(ActivityThread.java:7224)
                                                                                      at java.lang.reflect.Method.invoke(Native Method)
                                                                                      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
                                                                                      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)[/color]


la mia activity:

Codice (Java): [Seleziona]
package com.example.jo.androidkc1;


import android.annotation.SuppressLint;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.net.Uri;
import android.net.wifi.ScanResult;
import android.net.wifi.WifiManager;
import android.os.Bundle;
import android.os.Handler;
import android.speech.RecognizerIntent;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AlertDialog;
import android.support.v7.app.AppCompatActivity;
import android.view.Menu;
import android.view.MenuItem;
import android.view.MotionEvent;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.CompoundButton;
import android.widget.ListView;
import android.widget.Toast;
import android.widget.ToggleButton;

import com.google.android.gms.appindexing.Action;
import com.google.android.gms.appindexing.Thing;
import com.google.android.gms.common.api.GoogleApiClient;

import java.util.ArrayList;
import java.util.List;




/**
 * An example full-screen activity that shows and hides the system UI (i.e.
 * status bar and navigation/system bar) with user interaction.
 */

public class FullscreenActivity extends AppCompatActivity {
    /**
     * Whether or not the system UI should be auto-hidden after
     * {@link #AUTO_HIDE_DELAY_MILLIS} milliseconds.
     */

    private static final boolean AUTO_HIDE = true;

    private static final int DIALOG_CONFIRM_ID=1;


    /**
     * voice intent var
     */


    private static final int REQUEST_CODE = 1234;
    private ListView wordsList;

    /**
     * If {@link #AUTO_HIDE} is set, the number of milliseconds to wait after
     * user interaction before hiding the system UI.
     */

    private static final int AUTO_HIDE_DELAY_MILLIS = 3000;

    /**
     * Some older devices needs a small delay between UI widget updates
     * and a change of the status and navigation bar.
     */

    private static final int UI_ANIMATION_DELAY = 300;
    private final Handler mHideHandler = new Handler();
    private View mContentView;
    private final Runnable mHidePart2Runnable = new Runnable() {
        @SuppressLint("InlinedApi")
        @Override
        public void run() {
            // Delayed removal of status and navigation bar

            // Note that some of these constants are new as of API 16 (Jelly Bean)
            // and API 19 (KitKat). It is safe to use them, as they are inlined
            // at compile-time and do nothing on earlier devices.
            mContentView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LOW_PROFILE
                    | View.SYSTEM_UI_FLAG_FULLSCREEN
                    | View.SYSTEM_UI_FLAG_LAYOUT_STABLE
                    | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY
                    | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
                    | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION);
        }
    };
    private View mControlsView;
    private final Runnable mShowPart2Runnable = new Runnable() {
        @Override
        public void run() {
            // Delayed display of UI elements
            ActionBar actionBar = getSupportActionBar();
            getSupportActionBar().setDisplayShowHomeEnabled(true);
            getSupportActionBar().setLogo(R.drawable.bmecc24);
            getSupportActionBar().setDisplayUseLogoEnabled(true);
            /*getActionBar().setIcon(R.drawable.bmecc24);*/
            if (actionBar != null) {
                /*getActionBar().setIcon(R.drawable.bmecc24);*/
                actionBar.show();
            }
            mControlsView.setVisibility(View.VISIBLE);
        }
    };
    private boolean mVisible;
    private final Runnable mHideRunnable = new Runnable() {
        @Override
        public void run() {
            hide();
        }
    };
    /**
     * Touch listener to use for in-layout UI controls to delay hiding the
     * system UI. This is to prevent the jarring behavior of controls going away
     * while interacting with activity UI.
     */

    private final View.OnTouchListener mDelayHideTouchListener = new View.OnTouchListener() {
        @Override
        public boolean onTouch(View view, MotionEvent motionEvent) {
            if (AUTO_HIDE) {
                delayedHide(AUTO_HIDE_DELAY_MILLIS);
            }
            return false;
        }
    };
    /**
     * ATTENTION: This was auto-generated to implement the App Indexing API.
     * See https://g.co/AppIndexing/AndroidStudio for more information.
     */

    private GoogleApiClient client;

    private ProgressDialog mProgressDialog;
    private Context contxt;

    ToggleButton one;
    ToggleButton two;
    ToggleButton three;
    ToggleButton four;
    ToggleButton ak;
    ToggleButton bk;
    ToggleButton ck;
    ToggleButton voicek;
    ToggleButton manK;
    ToggleButton autoK;
    ToggleButton com1;
    ToggleButton com2;
    ToggleButton emek;
    ToggleButton onoffk;



    WifiManager wifi;
    List<ScanResult> wifiList;
    //WifiReceiver wifiReceiver;
    ListView lstView;
    ArrayAdapter<String> adapter;
    ArrayList<String> wifiResults;


   /* @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        list = (ListView)findViewById(R.id.listView1);
        mainWifiObj = (WifiManager) getSystemService(Context.WIFI_SERVICE);
        wifiReciever = new WifiScanReceiver();
        mainWifiObj.startScan();

    }*/

   /* protected void onPause() {
        unregisterReceiver(wifiReciever);
        super.onPause();
    }

    protected void onResume() {
        registerReceiver(wifiReciever, new IntentFilter(
                WifiManager.SCAN_RESULTS_AVAILABLE_ACTION));
        super.onResume();
    }*/

   // public class WifiScanReceiver extends BroadcastReceiver {
    //    @SuppressLint("UseValueOf")
      /*  public void onReceive(Context c, Intent intent) {
            setContentView(R.layout.wifidiag_layout);
            List<ScanResult> wifiScanList = mainWifiObj.getScanResults();
            wifis = new String[wifiScanList.size()];
            for(int i = 0; i < wifiScanList.size(); i++){
                wifis[i] = ((wifiScanList.get(i)).toString());
            }*/

            /*String filtered[] = new String[wifiScanList.size()];
            int counter = 0;
            for (String eachWifi : wifis) {
                String[] temp = eachWifi.split(",");

                filtered[counter] = temp[0].substring(5).trim()+"\n" + temp[2].substring(12).trim()+"\n" +temp[3].substring(6).trim();//0->SSID, 2->Key Management 3-> Strength


                counter++;

            }*/

           /* list.setAdapter(new ArrayAdapter<String>(getApplicationContext(),
                    android.R.layout.simple_list_item_1, wifis));*/


            /* @Override
                public void showDialog(){
                    AlertDialog.Builder dialog = new AlertDialog.Builder(getContext());
                    dialog.setTitle("Avaible WiFI Point");
                    dialog.setCancelable(true);

                    View view = ((Activity)getContext()).getLayoutInflater().inflate(R.layout.wifi_list, null);

                    dbobj = new DataBaseHandler(getContext());
                    likeItems=dbobj.select_HowlikeComment();
                    dbobj.CloseDataBase();


                    ListView list = (ListView) view.findViewById(R.id.WiFiList);
                    LikersCustomeAdapter adapter= new LikersCustomeAdapter(getContext(), R.layout.wifidialog_list, likeItems);

                    list.setAdapter(adapter);

                    dialog.setView(view);
                    dialog.show();
                }*/



       // }
    ///}







    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        setContentView(R.layout.activity_fullscreen);

        mVisible = true;
        mControlsView = findViewById(R.id.fullscreen_content_controls);
        mContentView = findViewById(R.id.fullscreen_content);

        one = (ToggleButton) findViewById(R.id.start);
        two = (ToggleButton) findViewById(R.id.stop);
        three = (ToggleButton) findViewById(R.id.pause);
        four = (ToggleButton) findViewById(R.id.step);
        ak = (ToggleButton) findViewById(R.id.a);
        bk = (ToggleButton) findViewById(R.id.b);
        ck = (ToggleButton) findViewById(R.id.c);
        voicek = (ToggleButton) findViewById(R.id.voice);
        manK = (ToggleButton) findViewById(R.id.man);
        autoK = (ToggleButton) findViewById(R.id.auto);
        com1 = (ToggleButton) findViewById(R.id.mdi1);
        com2 = (ToggleButton) findViewById(R.id.mdi2);
        emek = (ToggleButton) findViewById(R.id.eme);
        onoffk = (ToggleButton) findViewById(R.id.on_off);


        one.setOnCheckedChangeListener(changeChecker);
        two.setOnCheckedChangeListener(changeChecker);
        three.setOnCheckedChangeListener(changeChecker);
        four.setOnCheckedChangeListener(changeChecker);
        ak.setOnCheckedChangeListener(changeChecker);
        bk.setOnCheckedChangeListener(changeChecker);
        ck.setOnCheckedChangeListener(changeChecker);
        voicek.setOnCheckedChangeListener(changeChecker);
        manK.setOnCheckedChangeListener(changeChecker);
        autoK.setOnCheckedChangeListener(changeChecker);
        com1.setOnCheckedChangeListener(changeChecker);
        com2.setOnCheckedChangeListener(changeChecker);
        emek.setOnCheckedChangeListener(changeChecker);
        onoffk.setOnCheckedChangeListener(changeChecker);



        // Set up the user interaction to manually show or hide the system UI.
        mContentView.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                toggle();
            }
        });

        // Upon interacting with UI controls, delay any scheduled hide()
        // operations to prevent the jarring behavior of controls going away
        // while interacting with the UI.
        findViewById(R.id.fullscreen_content).setOnTouchListener(mDelayHideTouchListener);
        // ATTENTION: This was auto-generated to implement the App Indexing API.
        // See https://g.co/AppIndexing/AndroidStudio for more information.Button speakButton = (Button) findViewById(R.id.speakButton);

        //Button speakButton = (Button) findViewById(R.id.voice);


        // Disable button if no recognition service is present
      /**************************  PackageManager pm = getPackageManager();
        List<ResolveInfo> activities = pm.queryIntentActivities(
                new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH), 0);
        if (activities.size() == 0)
        {
            voicek.setEnabled(false);
            voicek.setText("Recognizer not present");
        }******************************/






    }

   /* private void askForPermission(String permission, Integer requestCode) {
        if (ContextCompat.checkSelfPermission(FullscreenActivity.this, permission) != PackageManager.PERMISSION_GRANTED) {

            // Should we show an explanation?
            if (ActivityCompat.shouldShowRequestPermissionRationale(FullscreenActivity.this, permission)) {

                //This is called if user has denied the permission before
                //In this case I am just asking the permission again
                ActivityCompat.requestPermissions(FullscreenActivity.this, new String[]{permission}, requestCode);

            } else {

                ActivityCompat.requestPermissions(FullscreenActivity.this, new String[]{permission}, requestCode);
            }
        } else {
            Toast.makeText(this, "" + permission + " is already granted.", Toast.LENGTH_SHORT).show();
        }
    }*/

    /**
     * Handle the action of the button being clicked
     */

   /**************************** public void speakButtonClicked(View v)
    {
        startVoiceRecognitionActivity();
    }***********************************/


    /**
     * Fire an intent to start the voice recognition activity.
     */

   /************************** private void startVoiceRecognitionActivity()
    {
        Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
        intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,
                RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);
        intent.putExtra(RecognizerIntent.EXTRA_PROMPT, "Voice recognition Demo...");
        startActivityForResult(intent, REQUEST_CODE);
    }*************************************/


    /**
     * Handle the results from the voice recognition activity.
     */

    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data)
    {
        if (requestCode == REQUEST_CODE && resultCode == RESULT_OK)
        {
            // Populate the wordsList with the String values the recognition engine thought it heard
            ArrayList<String> matches = data.getStringArrayListExtra(
                    RecognizerIntent.EXTRA_RESULTS);
            wordsList.setAdapter(new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1,
                    matches));
        }
        super.onActivityResult(requestCode, resultCode, data);
    }



    CompoundButton.OnCheckedChangeListener changeChecker = new CompoundButton.OnCheckedChangeListener() {

        @Override
        public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
            if (isChecked){
                if (buttonView == one) {
                    two.setChecked(false);
                    three.setChecked(false);
                    four.setChecked(false);
                }
                if (buttonView == two) {
                    one.setChecked(false);
                    three.setChecked(false);
                    four.setChecked(false);
                }
                if (buttonView == three) {
                    two.setChecked(false);
                    one.setChecked(false);
                    four.setChecked(false);
                }
                if (buttonView == four) {
                    two.setChecked(false);
                    three.setChecked(false);
                    one.setChecked(false);
                }
            }
            if (isChecked){
                if (buttonView == ak) {
                    bk.setChecked(false);
                    ck.setChecked(false);
                }
                if (buttonView == bk) {
                    ak.setChecked(false);
                    ck.setChecked(false);
                }
                if (buttonView == ck) {
                    ak.setChecked(false);
                    bk.setChecked(false);
                }
            }
            if (isChecked){
                if (buttonView == manK) {
                    autoK.setChecked(false);
                }
                if (buttonView == autoK) {
                    manK.setChecked(false);
                }
            }
            if (isChecked){
                if (buttonView == com1) {
                    com2.setChecked(false);
                }
                if (buttonView == com2) {
                    com1.setChecked(false);
                }
            }
            if (isChecked){
                if (buttonView == emek) {
                    onoffk.setChecked(false);
                    one.setChecked(false);
                    three.setChecked(false);
                    four.setChecked(false);
                    autoK.setChecked(false);
                    onoffk.setEnabled(false);
                    one.setEnabled(false);
                    three.setEnabled(false);
                    four.setEnabled(false);
                    autoK.setEnabled(false);

                }
                else{
                    onoffk.setEnabled(true);
                    one.setEnabled(true);
                    three.setEnabled(true);
                    four.setEnabled(true);
                    autoK.setEnabled(true);
                }

            }


        }
    };

    private boolean isWifiConnected() {
        ConnectivityManager connMgr = (ConnectivityManager)
                getSystemService(Context.CONNECTIVITY_SERVICE);
        NetworkInfo networkInfo = connMgr.getActiveNetworkInfo();
        return networkInfo != null && (ConnectivityManager.TYPE_WIFI == networkInfo.getType()) && networkInfo.isConnected();
    }


    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        /*menu.add("Cerca Connessione");
        menu.add("Scelta Dispositivo");
        menu.add("Comandi Robot");
        menu.add("Comandi Impianto");
        menu.add("Help");*/

        menu.clear();

        getMenuInflater().inflate(R.menu.kc1info, menu);
        getMenuInflater().inflate(R.menu.kc1menu, menu);

        /*if (isWifiConnected()) {


            WifiManager wifiMgr = (WifiManager) contxt.getSystemService(Context.WIFI_SERVICE);
            List<WifiConfiguration> list = wifiMgr.getConfiguredNetworks();

            @Override
            public void connectToWifi(String ssid) {

                WifiConfiguration conf = new WifiConfiguration();
                conf.SSID = "\"" + ssid + "\""; // Please note the quotes.
                // String should contain
                // ssid in quotes

                conf.allowedKeyManagement.set(WifiConfiguration.KeyMgmt.NONE);

                wifiMgr.addNetwork(conf);
                //Log.d(PluginConstants.LOG_TAG, ssid+" added");

                List<WifiConfiguration> list = wifiMgr.getConfiguredNetworks();
                for (WifiConfiguration i : list) {
                    if (i.SSID != null && i.SSID.equals("\"" + ssid + "\"")) {
                        wifiMgr.disconnect();
                        wifiMgr.enableNetwork(i.networkId, true);
                        wifiMgr.reconnect();
                        //Log.d(PluginConstants.LOG_TAG, "conneting to: ssid");
                        break;
                    }
                }
            };

        } else {
            new AlertDialog.Builder(this)
                    .setTitle("No Internet Connection")
                    .setMessage("It looks like your internet connection is off. " +
                            "Please turn it ON" +
                            "Using The Menù on Top Right" +
                            "Choose Only Connection Mark As:" +
                            "    kmbServer    ")
                    .setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
                        public void onClick(DialogInterface dialog, int which) {

                        }
                    }).setIcon(android.R.drawable.ic_dialog_alert).show();
        }*/


        return true;
    }


    /*WifiManager wifi;
    List<ScanResult> wifiList;
    WifiReceiver wifiReceiver;
    ListView lstView;
    ArrayAdapter<String> adapter;
    ArrayList<String> wifiResults;*/



    /*class WifiReceiver extends BroadcastReceiver {
        public void onReceive(Context c, Intent intent) {
            wifiResults.clear();
            wifiList = wifi.getScanResults();
            for(int i = 0; i < wifiList.size(); i++){
                wifiResults.add(wifiList.get(i).toString());
            }
            adapter.notifyDataSetChanged();
        }

    }*/


    /*public void scanWifi(View view){
        // Scan wifi
        wifi.startScan();

    }*/


    /*protected void onResume(){
        super.onResume();
        // Register wifi receiver to get the results
        registerReceiver(wifiReceiver, new IntentFilter(WifiManager.SCAN_RESULTS_AVAILABLE_ACTION));

    }*/


   /* protected void onPause(){
        super.onPause();
        // Unregister the wifi receiver
        unregisterReceiver(wifiReceiver);

    }*/


    /**
     * Showing google speech input dialog
     * */

   /* private void promptSpeechInput() {
        Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
        intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,
                RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);
        intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE, Locale.getDefault());
        intent.putExtra(RecognizerIntent.EXTRA_PROMPT,
                getString(R.string.speech_prompt));
        try {
            startActivityForResult(intent, REQ_CODE_SPEECH_INPUT);
        } catch (ActivityNotFoundException a) {
            Toast.makeText(getApplicationContext(),
                    getString(R.string.speech_not_supported),
                    Toast.LENGTH_SHORT).show();
        }
    }*/


    /**
     * Receiving speech input
     * */

    /*@Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);

        switch (requestCode) {
            case REQ_CODE_SPEECH_INPUT: {
                if (resultCode == RESULT_OK && null != data) {

                    ArrayList<String> result = data
                            .getStringArrayListExtra(RecognizerIntent.EXTRA_RESULTS);
                    BreakIterator txtSpeechInput;
                    txtSpeechInput.setText(result.get(0));
                }
                break;
            }

        }
    }*/







    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        int id = item.getItemId(); /*sono nel menu e vedo le voci -- layout menu*/


        if(id == R.id.cerca_connessione){ /*clicco su questa voce*/
            //setContentView(R.layout.wifi_list); /*se siamo connessi allora setto il layout lista ... è corretto??*/
            /*wifiResults=new ArrayList<String>();  // ma in questo modo utilizzo la classe wifireceiver o no??
            final ListView lstView = (ListView) findViewById(R.id.WiFiList);
            final ArrayAdapter<String> adapter = new ArrayAdapter<String> (this, R.layout.wifidiag_layout,R.id.wifi_name, wifiResults);
            lstView.setAdapter(adapter);*/




            if(isWifiConnected()){

                Intent intent = new Intent(getApplicationContext(),ConnectionDisp.class);
                startActivity(intent);

                //onResume();


                //setContentView(R.layout.wifi_list); /*se siamo connessi allora setto il layout lista ... è corretto??*/

                //wifiReceiver = new WifiReceiver();


                /*wifi = (WifiManager)this.getSystemService(Context.WIFI_SERVICE);
                wifiResults=new ArrayList<String>();  // ma in questo modo utilizzo la classe wifireceiver o no??

                final ListView lstView = (ListView) findViewById(R.id.WiFiList);
                final ArrayAdapter<String> adapter = new ArrayAdapter<String> (this, R.layout.wifidiag_layout,R.id.wifi_name, wifiResults);
                lstView.setAdapter(adapter);*/

                //final ListView lstView = (ListView) findViewById(R.id.WiFiList);
                //lstView.setAdapter(adapter);

                //onResume(); /* devo chiamarlo prima di wifiresult??*/
                //wifi.startScan(); /* devo chiamarlo prima di onResume o va bene dopo?  ... da quello che ho capito dopo ... prima abilito e poi cerco ... corretto?*/
                //wifiReceiver = new WifiReceiver();
                //((ListView)findViewById(R.id.WiFiList)).setAdapter(adapter);




                //onResume();



                /*setContentView(R.layout.wifidiag_layout);
                //list = (ListView)findViewById(R.id.wifi_name);
                mainWifiObj = (WifiManager) getSystemService(Context.WIFI_SERVICE);
                wifiReciever = new WifiScanReceiver();
                mainWifiObj.startScan();
                List<ScanResult> list = wm.getScanResults();
        for(int i=0;i<list.size();i++)
                        {
                                Log.i("SSID: ", String.valueOf(list.get(i).SSID)+"\n");
                                Log.i("BSSID: ", String.valueOf(list.get(i).BSSID));
                                Log.i("LEVEL: ", String.valueOf(list.get(i).level+"\n"));
                                Log.i("FREQUENCY: ", String.valueOf(list.get(i).frequency)+"\n");
                                Log.i("DESCRIBE CONTENTS: ", String.valueOf(list.get(i).describeContents())+"\n");
                                Log.i("CAPABILITIES: ", String.valueOf(list.get(i).capabilities)+"\n");

                                                                        }

                */

devo interrompre il codice non ci stà tutto dovrei fare un allegato ....
comunque il riferimento era a questa chiamata:

Codice (Java): [Seleziona]
    @Override
    public void onStart() {
        super.onStart();

        // ATTENTION: This was auto-generated to implement the App Indexing API.
        // See https://g.co/AppIndexing/AndroidStudio for more information.

        AppIndex.AppIndexApi.start(client, getIndexApiAction());
        client.connect();
    }

prima così funzionava ... ora pare debba prima effettuare il build di AppIndex .... ho provato ma senza riuscirci...

update:

a quanto pare ho solo fatto un pò di confusione .....

innanzitutto ho rimesso apposto il mio buil.grandle.module.... in questa sezione:

Codice (Java): [Seleziona]
dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        //exclude group: 'com.android.support', module: 'support-annotations'
    })
    // https://mvnrepository.com/artifact/net.wimpi/jamod
    //compile group: 'net.wimpi', name: 'jamod', version: '1.2'compile 'com.google.android.gms:play-services:11.0.1'

    compile files('libs/jamod.jar')
    //compile 'com.google.android.support:wearable:1.4.0'
    compile 'com.google.android.gms:play-services:11.0.1' /*******ho rimesso questa versione api precedentemente tolta *****/
    compile 'com.android.support:appcompat-v7:25.0.0'
    compile 'com.android.support:support-v4:25.0.0'
    compile 'com.google.android.gms:play-services-appindexing:9.8.0'
    compile 'com.android.support:support-v13:25.0.0'
    compile 'com.android.support:design:25.0.0'
    testCompile 'junit:junit:4.12'
    androidTestCompile 'com.android.support:support-annotations:25.2.0'
    compile 'com.google.android.support:wearable:2.0.3'
}


in oltre il codice che segnalava come errore, erronamente credevo facesse parte del vecchio codice per via della somiglianza nel nome delle vARIABILI.... eliminate le due funzioni incriminate tutto è tornato a funzioanre alla grande...


gfx
« Ultima modifica: 17 Giugno 2017, 14:22:02 CEST da gfx, Reason: Merged DoublePost »