2013-04-28 5 views
5

पढ़ने के लिए फ़ाइल नहीं खोल सकता है, मैं अपने गैलेक्सी एस 3 पर चलने पर एक त्रुटि प्राप्त कर रहा हूं "मेरे लॉगकैट में दो बार पढ़ने के लिए फ़ाइल नहीं खोल सकता"।<s3dReadConfigFile: 75>: त्रुटि

यहां मेरा कोड है: पैकेज com.example.speechrecognizertest;

import android.os.Bundle; 
import java.util.ArrayList; 
import java.util.List; 
import android.app.Activity; 
import android.content.Intent; 
import android.content.pm.PackageManager; 
import android.content.pm.ResolveInfo; 
import android.speech.RecognitionListener; 
import android.speech.RecognizerIntent; 
import android.speech.SpeechRecognizer; 
import android.util.Log; 
import android.widget.ArrayAdapter; 
import android.widget.Button; 
import android.widget.ListView; 
import android.widget.Toast; 
import android.widget.TextView; 
import android.app.Activity; 
import android.view.Menu; 

public class MainActivity extends Activity { 

public static final String TAG = null; 
private ListView wordList; 
private SpeechRecognizer mSpeechRecognizer; 
private Intent mSpeechRecognizerIntent; 
private boolean mIslistening; 

@Override 
protected void onCreate(Bundle savedInstanceState) { 
super.onCreate(savedInstanceState); 
setContentView(R.layout.activity_main); 
Button speechBtn = (Button) findViewById(R.id.speech_btn); 
wordList = (ListView) findViewById(R.id.word_list); 
PackageManager packManager = getPackageManager(); 
List<ResolveInfo> intActivities = packManager.queryIntentActivities(
     new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH), 0); 
mSpeechRecognizer = SpeechRecognizer.createSpeechRecognizer(this); 
mSpeechRecognizerIntent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH); 
mSpeechRecognizerIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, 
           RecognizerIntent.LANGUAGE_MODEL_FREE_FORM); 
mSpeechRecognizerIntent.putExtra(RecognizerIntent.EXTRA_CALLING_PACKAGE, 
           this.getPackageName()); 
if (!mIslistening) 
{ 
    mSpeechRecognizer.startListening(mSpeechRecognizerIntent); 
} else { 
    speechBtn.setEnabled(false); 
    Toast.makeText(this, "Oops - Speech Recognition Not Supported!", 
      Toast.LENGTH_LONG).show(); 
} 
} 


@Override 
protected void onDestroy() { 
if (mSpeechRecognizer != null) 
{ 
     mSpeechRecognizer.destroy(); 
} 
super.onDestroy(); 
} 


@Override 
public boolean onCreateOptionsMenu(Menu menu) { 
// Inflate the menu; this adds items to the action bar if it is present. 
getMenuInflater().inflate(R.menu.main, menu); 
return true; 
} 



protected class SpeechRecognitionListener implements RecognitionListener 
{ 

@Override 
public void onBeginningOfSpeech() 
{    
    Log.d(TAG, "onBeginingOfSpeech"); 
} 

@Override 
public void onBufferReceived(byte[] buffer) 
{ 

} 

@Override 
public void onEndOfSpeech() 
{ 
    Log.d(TAG, "onEndOfSpeech"); 
} 

@Override 
public void onError(int error) 
{ 
    mSpeechRecognizer.startListening(mSpeechRecognizerIntent); 

    Log.d(TAG, "error = " + error); 
} 

@Override 
public void onEvent(int eventType, Bundle params) 
{ 

} 

@Override 
public void onPartialResults(Bundle partialResults) 
{ 

} 

@Override 
public void onReadyForSpeech(Bundle params) 
{ 
    Log.d(TAG, "OnReadyForSpeech"); //$NON-NLS-1$ 
} 

@Override 
public void onResults(Bundle results) 
{ 
    //Log.d(TAG, "onResults"); //$NON-NLS-1$ 
    ArrayList<String> suggestedWords = results.getStringArrayList(SpeechRecognizer.RESULTS_RECOGNITION); 
    // matches are the return values of speech recognition engine 
    // Use these values for whatever you wish to do 

    wordList.setAdapter(new ArrayAdapter<String>(MainActivity.this, R.layout.word, suggestedWords)); 



} 

@Override 
public void onRmsChanged(float rmsdB){}} 


} 

मेरा लॉगकैट जो मैंने वर्णित किया है, उसे प्रदर्शित कर रहा है। वास्तव में एक फिक्स दोस्तों की सराहना करेंगे!

+0

डुप्लीकेट हो सकता है: निम्न थ्रेड की जांच करें: http://stackoverflow.com/questions/15280681/device-specific-error-s3dreadconfigfile-cant-open-file-for-reading – Surya

उत्तर

0

मैंने इसे अपने एस 3 पर कई महीनों के लिए देखा है और यह कभी भी किसी भी समस्या का कारण नहीं दिखता है। The answer here मेरे लिए संभावित लगता है।

संबंधित मुद्दे