1

リンクされたソーシャル ネットワークをサポートした後、私が取り組んでいるアプリが多くのクラッシュを引き起こしました。そこに書かれているのは「androidApplicationContext は null ではない必要があります!」だけです。.

私はインターネットを検索しましたが、次のリンクのみが手がかりとして見つかりました:

Aug 28 17:15:23 <S3nsat10n> has anyone run across a stacktrace like this? http://pastebin.com/QeV9D8XH
Aug 28 17:15:33 <S3nsat10n> has to do with a null app context inside the apache httpclient
Aug 28 17:15:38 <Hodapp> wongk: yeah, I'm just really confused about why it's doing this...
Aug 28 17:15:47 <S3nsat10n> highly modified httpclient it would seem, judging my the naf.gba package stuff
Aug 28 17:15:51 <S3nsat10n> Seems to be happening only on Samsung Galaxy S devices, but I don't know if that's always the case.
Aug 28 17:16:48 <wongk> S3nsat10n: never see that
Aug 28 17:16:50 <wongk> seen
Aug 28 17:17:17 <S3nsat10n> yeah :/
Aug 28 17:17:22 <S3nsat10n> neither has most of the internet...
Aug 28 17:17:23 <S3nsat10n> heh

他の誰かがこの奇妙で非常にまれなエラーを抱えていますか?

もしそうなら、どのように修正しましたか?

4

1 に答える 1

1

2 つのソリューション:

  • HttpClientの代わりにHttpURLConnectionを使用する
  • アプリケーションのメイン スレッドで、できるだけ早くHttpClientのインスタンスを作成します (たとえば、そのonCreateメソッドで)。

詳細はこちら

于 2013-08-02T08:21:27.567 に答える