0

エミュレータでアプリケーションを実行すると、logcat メッセージが ..

05-29 13:45:06.941: W/ActivityManager(59): Launch timeout has expired, giving up wake lock!
05-29 13:45:07.152: W/ActivityManager(59): Activity idle timeout for HistoryRecord{45163410 com.integrated.mpr/.Progress}
05-29 13:45:07.241: D/dalvikvm(5422): GC_FOR_MALLOC freed 43964 objects / 1967584 bytes in 138ms
05-29 13:45:08.401: D/dalvikvm(5422): GC_FOR_MALLOC freed 73 objects / 536016 bytes in 65ms
05-29 13:45:09.631: W/ActivityManager(59): Activity idle timeout for HistoryRecord{450e8e38 com.integrated.mpr/.SensitiveList}

パッケージ com.integrated.mpr と呼ばれる関数。

import org.apache.commons.math.linear.RealMatrix;
import org.apache.commons.math.stat.correlation.Covariance;
import org.apache.commons.math.stat.correlation.PearsonsCorrelation;
import org.apache.commons.math.util.FastMath;

import android.util.Log;

public class Logic {

    int n = Choose.n;
    double final_matrix[][] = new double[n][5];
    double swap =0;

    double weightage_matrix[] = {0,0,0,0,0,0,0,0,0,0,0};
    double sorted_weightage[] = {0,0,0,0,0,0,0,0,0,0};
    String  display[] = new String[n]; 

    double input_matrix[][] = new double[22050][n];
    double[] peak_matrix = new double[n];
    double[] sd_matrix = new double[n];
    double[] rms_matrix = new double[n];
    double[] cf_matrix = new double[n];
    double[] mean_matrix = new double[n];
    int[] sensitive_positions = new int[n];
    double[] new_sensitive = new double[n];
    int[] sortsensi = new int[n];


    public String[] finaldata(){



        for(int i=0;i<n;i++){
            peak_matrix[i] = Choose.timedata[i*5+0];
            sd_matrix[i] = Choose.timedata[i*5+1];
            rms_matrix[i] = Choose.timedata[i*5+2];
            cf_matrix[i] = Choose.timedata[i*5+3];
            mean_matrix[i] = Choose.timedata[i*5+4];
        }

        // Arrays sorted in asecnding order
        java.util.Arrays.sort(peak_matrix);
        java.util.Arrays.sort(sd_matrix);
        java.util.Arrays.sort(rms_matrix);
        java.util.Arrays.sort(mean_matrix);
        java.util.Arrays.sort(cf_matrix);



    for(int i = 0;i<n;i++){
        final_matrix[i][0]= peak_matrix[i];
        final_matrix[i][1]= sd_matrix[i];
        final_matrix[i][2]= rms_matrix[i];
        final_matrix[i][3]= cf_matrix[i];
        final_matrix[i][4]= mean_matrix[i];
    }
    Log.d("final matrix", "final matrix 0 0" +final_matrix[0][0]);
    Log.d("final matrix", "final matrix 1 0" +final_matrix[1][0]);
    Log.d("final matrix", "final matrix 2 0" +final_matrix[2][0]);

    Log.d("final matrix", "final matrix 3 0" +final_matrix[3][0]);
    Log.d("final matrix", "final matrix 4 0" +final_matrix[4][0]);

    //final sorted matrix obtained
    for(int i =0;i<n;i++){
            for(int j=0;j<5;j++){
                if(final_matrix[i][j]== Page1.timedata1[j]){
                    weightage_matrix[0] = weightage_matrix[0]+i+1;
                }
                else if (final_matrix[i][j]== Page2.timedata2[j]){
                    weightage_matrix[1] = weightage_matrix[1]+i+1;
                }
                else if (final_matrix[i][j]== Page3.timedata3[j]){
                    weightage_matrix[2] = weightage_matrix[2]+i+1;
                }
                else if (final_matrix[i][j]== Page4.timedata4[j]){
                    weightage_matrix[3] = weightage_matrix[3]+i+1;
                }

                else{
                    weightage_matrix[4] = weightage_matrix[4]+i+1;
                }
        }
    }
    //copying the values into sorted matrix;


    for(int i=0;i<n;i++){
        sorted_weightage[i] = weightage_matrix[i];
    }

    //sorting weighatge matrix in descending order

        for (int i = 0;i<n; i++ )
           {
              for ( int j = 0 ; j < n-i-1 ; j++ )
              {
                  if ( sorted_weightage[j] <sorted_weightage[j+1] ) {
                        swap = sorted_weightage[j];
                        sorted_weightage[j] = sorted_weightage[j+1];
                        sorted_weightage[j+1] = swap;
                  }
              }

           }

    //  String[] display= new String [n];
        /*
        Log.d("", "weightage matrix0 " +weightage_matrix[0]);
        Log.d("", "weightage matrix0 " +weightage_matrix[1]);
        Log.d("", "weightage matrix0 " +weightage_matrix[2]);
        Log.d("", "weightage matrix0 " +weightage_matrix[3]);
        Log.d("", "weightage matrix0 " +weightage_matrix[4]);

        for(int i =0;i<n;i++){
            Log.d("posnames", new Choose().posnames[i]);
        }
        */
    for(int i =0;i<n;i++){
        double temp = sorted_weightage[i];
        for(int j =0;j<n;j++){
            if(temp==weightage_matrix[j]){
                sensitive_positions[i]=j+1;
            }
        }
    }
    //IT IS RUNNING UPTO THIS POINT AND NOW IT GIVES THE LOGCAT MESSAGE OF LAUNCHTIME



    //now for correaltion


    // genearting the input matrix for correaltion


    for(int i=0;i<n;i++){
        for(int j=0;j<22050;j++){
            input_matrix[j][i] =  new Choose().rawdata[i*22050+j];
        }
    }

    // now generating correlation matrix of N x n by using pearson correaltion


    RealMatrix pcorrdata = new PearsonsCorrelation().computeCorrelationMatrix(input_matrix);


    Log.d("checkng correlation mtrix", "yup");

    for(int i =0;i<n;i++){
        for(int j =0;j<n;j++){

            if(pcorrdata.getEntry(i, j)<0){
                pcorrdata.setEntry(i, j, pcorrdata.getEntry(i, j)*-1);
            }
            Log.d(" value", ""+pcorrdata.getEntry(i, j));
        }
    }

    for(int i =0;i<n;i++){
        Log.d("sensitive osition before correlation", ""+sensitive_positions[i]);
    }



    int[] perm_sensitive = sensitive_positions;


    if((pcorrdata.getEntry(perm_sensitive[0]-1, perm_sensitive[1]-1))>0.5){
        sensitive_positions = append(perm_sensitive[1],sensitive_positions);
    }


    for(int i = 0;i<n;i++){
        for(int j =0;j<n;j++){
            if(i==sensitive_positions[0]-1){
                if((j==sensitive_positions[1]-1)){
                    if(pcorrdata.getEntry(i, j)>0.5){
                        sensitive_positions = append(j,sensitive_positions);
                        }
                    }
                }
            }
        }




    if((pcorrdata.getEntry(perm_sensitive[0]-1, perm_sensitive[2]-1))>0.5){
        sensitive_positions = append(perm_sensitive[2],sensitive_positions);
    }





    if((pcorrdata.getEntry(perm_sensitive[0]-1, perm_sensitive[3]-1))>0.5){
        sensitive_positions = append(perm_sensitive[3],sensitive_positions);
    }




    perm_sensitive = sensitive_positions;

    if((pcorrdata.getEntry(perm_sensitive[1]-1, perm_sensitive[2]-1))>0.5){
        sensitive_positions = append(perm_sensitive[2],sensitive_positions);
    }



    if((pcorrdata.getEntry(perm_sensitive[1]-1, perm_sensitive[3]-1))>0.5){
        sensitive_positions = append(perm_sensitive[3],sensitive_positions);
    }




    perm_sensitive = sensitive_positions;


    if((pcorrdata.getEntry(perm_sensitive[2]-1, perm_sensitive[3]-1))>0.5){
        sensitive_positions = append(perm_sensitive[3],sensitive_positions);
    }

    for(int i =0;i<n;i++){
        Log.d("values aft 6th exchange","" +sensitive_positions[i]);
    }

    perm_sensitive = sensitive_positions;

    Log.d("checkng vales", "after correlation");

    for(int i =0;i<n;i++){
        Log.d("values",""+perm_sensitive[i]);
    }


    for(int i =0;i<n;i++){
        display[i] = new Choose().posnames[perm_sensitive[i]-1];
    }

    return display;

    }


    private int[] append(int j, int[] sensitive_positions) {
        // TODO Auto-generated method stub

        int[] sort_sensitive = new int[n];
        int z = 0;
        for(int i =0;i<n;i++){
            if(sensitive_positions[i]!=j){
                sort_sensitive[z]=sensitive_positions[i];
                z = z+1;
            }
        }
        sort_sensitive[n-1] = j;
        return sort_sensitive;
    }







}

実際には、次のアクティビティの oncreate メソッドで、計算を行う別のクラスの関数を呼び出しています。それが理由ですか..もしそうなら、どうすればそれを削除できますか?

それでも空白の画面の後、次のアクティビティが開きます..

しかし、電話で実行しようとすると、強制終了します。どうすればこれを削除できますか..助けてください?

4

2 に答える 2

0

これは、メイン スレッドが継続的に実行され、アイドル状態になることなくメッセージ キューを介してメッセージを送り出すことを意味します。それがあなたの望むものなら、修正するものは何もありません。これが、ログ メッセージがエラーではなく警告である理由です

詳細を見る.

于 2012-05-29T08:31:50.697 に答える