fatal error occurred in main thread

I am new to android. My project is related to networking. I am getting this error FATAL EXCEPTION: main

Here is main.xml code

It’s not even displaying the toast message after clicking the button. However it’s showing error in android.os.NetworkOnMainThreadException .

4 Answers 4

This exception is thrown when an application attempts to perform a networking operation on its main thread

MyClass.class AsyncTask

You cannot perform network IO on the UI thread on Honeycomb. Technically it is possible on earlier versions of Android, but is a really bad idea as it will cause your app to stop responding, and can result in the OS killing your app for being badly behaved. You’ll need to run a background process or use AsyncTask to perform your network transaction on a background thread.

There is an article about Painless Threading on the Android developer site which is a good introduction to this, and will provide you with much better depth of answer than can be realistically provided here.

Доступ к запрашиваемому ресурсу ограничен по решению суда или по иным основаниям, установленным законодательством Российской Федерации

  1. Доступ ограничен по решению суда или по иным основаниям, установленным законодательством Российской Федерации.
  2. Указатель страницы и (или) доменное имя сайта, сетевой адрес включены в Единый Реестр доменных имен, указателей страниц сайтов сети «Интернет» и сетевых адресов, позволяющих идентифицировать сайты в сети «Интернет», содержащие информацию, распространение которой в Российской Федерации запрещено.

by razvangrig » Tue Feb 19, 2013 12:46 am

Hi all, I have the following problem:

Software ver.: iGo Primo 2.4 Build 9.6.13.267029 (November 2012)
Maps ver.: iGO Navteq Europa 2012.Q3

CPU: Mediatek 3351C / 468 MHz
GPS module: Mediatek MT 3328 / 22 channels
RAM memory: 128 MB
ROM: 4GB flash
Memory card: MicroSD
4.3” TFT LCD
Resolution: 480 x 272
Screen type: landscape
Windows CE 6.0

Port: COM1
Baudrate: 4800
Protocol: NMEA

The values above regarding port, baudrate and protocol were detected using GPSScan_Debug.exe utility.

This is my current sys.txt file:

[debug]
skip_eula=1
experimental_features=1

[interface]
show_exit=1
extra_settings=1

[route]
hnr_ignored_missing_country_ >
[vr]
disabled=0

I use diMka skin, romanian map and romanian TTS Pro file «Voice_TTS-nua-rom-f4-lua-dri40-155mrf22.zip»

After going to Settings>Sound and Warnings>Voice Language>Choose the TTS Voice, i tap on the the romanian TTS voice and I hear a correct speech sample. After I exit the voice menu, I get the following system error message:

Fatal error occured in main thread.
Address: 0x0004e2c8
Exception: 0xc0000005

First question is why am I getting this error? I installed all TTS files according to the instructions, in the right folders.

Second question is: given the specs of my PNA, specified above, should I add some lines in the sys.txt file, like baudrate=4800, port= com1, and specify the resolution for the device or the microsd path for primo.exe?

Thank you very much!

Joined: Thu May 12, 2011 12:11 pm Posts: 7 Has thanked: 0 time Been thanked: 0 time

Источник: computermaker.info

Техника и Гаджеты
Добавить комментарий