Android : Error when running this android app

on Thursday, September 11, 2014


Whenever I try running this app in the emulator I get this error:



09-11 05:34:08.580 859-859/com.spookyapps.lollatone D/dalvikvm﹕ GC_FOR_ALLOC freed 54K, 10% free 3448K/3792K, paused 28ms, total 29ms
09-11 05:34:08.650 859-859/com.spookyapps.lollatone I/dalvikvm-heap﹕ Grow heap (frag case) to 15.450MB for 12381028-byte allocation
09-11 05:34:08.680 859-868/com.spookyapps.lollatone D/dalvikvm﹕ GC_FOR_ALLOC freed 2K, 3% free 15536K/15884K, paused 28ms, total 28ms
09-11 05:34:09.410 859-859/com.spookyapps.lollatone D/dalvikvm﹕ GC_FOR_ALLOC freed 1K, 3% free 15760K/16108K, paused 27ms, total 27ms
09-11 05:34:09.430 859-859/com.spookyapps.lollatone I/dalvikvm-heap﹕ Grow heap (frag case) to 18.084MB for 2536936-byte allocation
09-11 05:34:09.470 859-868/com.spookyapps.lollatone D/dalvikvm﹕ GC_FOR_ALLOC freed <1K, 2% free 18237K/18588K, paused 32ms, total 32ms
09-11 05:34:09.640 859-859/com.spookyapps.lollatone D/AndroidRuntime﹕ Shutting down VM
09-11 05:34:09.640 859-859/com.spookyapps.lollatone W/dalvikvm﹕ threadid=1: thread exiting with uncaught exception (group=0xb1a19ba8)
09-11 05:34:09.650 859-872/com.spookyapps.lollatone W/dalvikvm﹕ threadid=11: thread exiting with uncaught exception (group=0xb1a19ba8)
09-11 05:34:09.650 859-872/com.spookyapps.lollatone I/Process﹕ Sending signal. PID: 859 SIG: 9


here is my main activity



package com.spookyapps.lollatone;

import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;


public class MainActivity extends Activity {

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

final Sounds mSound = new Sounds();
Thread thread = new Thread(new Runnable() {
public void run() {
mSound.record();
}
});
thread.start();


try {
wait(10000);
} catch (InterruptedException e) {
Log.e("Record", "wait failed");
}

//Sounds.mIsRecording = false;

try {
thread.join();
} catch (InterruptedException e) {
Log.e("Thread", "Join failed");
}

mSound.play();
finish();
/*GridView gridView = (GridView)findViewById(R.id.gridview);
gridView.setAdapter(new ImageAdapter(this));

gridView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> adapterView, View v, int position, long id) {
Toast.makeText(MainActivity.this, "" + position, Toast.LENGTH_LONG).show();
}
}); */
}


@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;
}

@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
if (id == R.id.action_settings) {
return true;
}
return super.onOptionsItemSelected(item);
}
}


It's supposed to automatically try recording audio and then then playing it back once the app starts but the app never starts at all and I just get those messages in the logcat


0 comments:

Post a Comment