システムの起動時に開始される Android 上のアプリケーションがあります。インターネット接続が検索モードになっている場合があり、タイマーを設定して接続を確認し、見つかった場合は接続します。SDカードも準備モードであるため、同じことを行いました。システムの起動時にSDカードからテキストファイルを読み取る際に問題が発生し、アプリが起動してもSDカードからテキストが読み取られません。後でアプリを手動で起動すると、機能します。SDカードファイルを読み取るための私のコードは次のとおりです。
 if (isSDCardAvailable())
            {
                setTickerText();
            }
    else if(!isSDCardAvailable())
            {
                //pop up message
                Toast toast=Toast.makeText(this, "Preparing SD card..", Toast.LENGTH_LONG);
                toast.show();
                //Run the sd card read process after 30 seconds
                Handler handler = new Handler(); 
                handler.postDelayed(new Runnable() { 
                     public void run() 
                     { 
                         setTickerText();
                     } 
                }, 30000);
            }
 public void setTickerText()
{
    File sdcard = Environment.getExternalStorageDirectory();
    //Get the text file
    File file = new File(sdcard,"TickerText.txt");
    //Read text from file
    StringBuilder text = new StringBuilder();
    try {
        BufferedReader br = new BufferedReader(new FileReader(file));
        String line;
        while ((line = br.readLine()) != null) {
            text.append(line);
            //text.append('\n');
        }
    }
    catch (IOException e) {
        //You'll need to add proper error handling here
    }
       }