Note that there are some explanatory texts on larger screens.

plurals
  1. POBase Byte Buffer error Occur in android
    primarykey
    data
    text
    <p>In my Project i have to add the activities into Tabhost.One of the Activities is InventoryView.When it is loaded into tabHost that time the stack overflow error and base byte buffer error occur. I don't know how to fix it. If anyone known it pls help me.</p> <p>Coding:</p> <pre><code>public class **TabActivityView** extends TabActivity { public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.listmonth); Resources res = getResources(); // Resource object to get Drawables TabHost tabHost = getTabHost(); // The activity TabHost Intent intent = new Intent(this,InventoryView.class); tabHost.addTab(tabHost // Error Occur While it is Set. .newTabSpec("Week") .setIndicator("Weekly", res.getDrawable(R.drawable.ic_tab_main)) .setContent(intent)); } } </code></pre> <p>In Inventory Class Contains:</p> <pre><code>package com.experts.IVScreen; import com.experts.clssfile.*; import java.util.Calendar; import android.content.Intent; import com.experts.IVScreen.R; import android.app.Activity; import android.database.sqlite.SQLiteDatabase; import android.database.Cursor; import android.os.Bundle; import android.view.View; import android.view.View.OnClickListener; import android.widget.*; import android.widget.AdapterView.OnItemSelectedListener; public class InventoryView extends Activity{ public String spintext; GetDetails gt = new GetDetails(); Databasecreation db = new Databasecreation(); String query; GridView list_disp=null; DatePicker sel_date; TextView disp_amt, date_text; Button btnDwnchart, btnDwnOk, btnDwnCancel; public int focus; ImageView btnNext, btnPre=null; SQLiteDatabase dbase; public StringBuffer buff = null; String mylog="Invent"; public String str; public String doentry; int tot_amt; public int iSelectedMonth; public String month[]={"January","February","March","April","May","June","July", "August","September","October","November","December"}; public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.listviewinvent); dbase = db.getdb(); Calendar csCalendar = Calendar.getInstance(); iSelectedMonth = csCalendar.get(Calendar.MONTH); Spinner mon_spin=(Spinner)findViewById(R.id.Spin_year); list_disp = (GridView)findViewById(R.id.gridView1); btnDwnchart = (Button) findViewById(R.id.btnChart); disp_amt = (TextView)findViewById(R.id.dispTotAmt); btnNext = (ImageView)findViewById(R.id.imageView1); btnPre = (ImageView)findViewById(R.id.imageView2); date_text = (TextView)findViewById(R.id.textView1); ArrayAdapter NoCoreAdapter = new ArrayAdapter(this,android.R.layout.simple_spinner_item, month); NoCoreAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); mon_spin.setAdapter(NoCoreAdapter); mon_spin.setOnItemSelectedListener(new MyOnItemSelectedListener()); date_text.setText(month[iSelectedMonth]); tot_amt = gt.getMonthlist(0,null, iSelectedMonth); dis_grid(tot_amt); btnDwnchart.setOnClickListener(new OnClickListener() { public void onClick(View v) { Intent intent = null; intent = new Intent(InventoryView.this,NewChart.class); startActivity(intent); } }); } public void btnDwnNext(View v) { if (iSelectedMonth &lt; 11) { iSelectedMonth++; } else { iSelectedMonth = 0; } date_text.setText(""+month[iSelectedMonth]); tot_amt = gt.getMonthlist(0,null, iSelectedMonth); dis_grid(tot_amt); } public void btnDwnPre(View v) { if (iSelectedMonth &gt; 0) { iSelectedMonth--; } else { iSelectedMonth = 11; } date_text.setText(""+month[iSelectedMonth]); tot_amt=gt.getMonthlist(0,null, iSelectedMonth); dis_grid(tot_amt); } public void dis_grid(int total) { String query1 = "Select DOENTRY1,NETAMOUNT1 as _id from Invent_Month"; Cursor mon = dbase.rawQuery(query1, null); mon.moveToFirst(); startManagingCursor(mon); SimpleCursorAdapter ada = new SimpleCursorAdapter(this, R.layout.showlist, mon, new String[] { "DOENTRY1", "_id" }, new int[] { R.id.Entry,R.id.sales }); list_disp.setAdapter(ada); String convert = String.valueOf(total); disp_amt.setText(convert); } public class MyOnItemSelectedListener implements OnItemSelectedListener { public void onItemSelected(AdapterView&lt;?&gt; parent,View view, int pos, long id) { spintext=parent.getItemAtPosition(pos).toString(); /*Toast.makeText(parent.getContext(), "The planet is " + parent.getItemAtPosition(pos).toString(), Toast.LENGTH_LONG).show();*/ } public void onNothingSelected(AdapterView parent) { // Do nothing. } } } </code></pre> <h2>Log Cat:</h2> <pre><code>06-15 16:26:27.328: E/AndroidRuntime(320): FATAL EXCEPTION: main 06-15 16:26:27.328: E/AndroidRuntime(320): java.lang.StackOverflowError 06-15 16:26:27.328: E/AndroidRuntime(320): at java.nio.ByteBuffer.&lt;init&gt;(ByteBuffer.java:128) 06-15 16:26:27.328: E/AndroidRuntime(320): at java.nio.BaseByteBuffer.&lt;init&gt;(BaseByteBuffer.java:26) 06-15 16:26:27.328: E/AndroidRuntime(320): at java.nio.HeapByteBuffer.&lt;init&gt;(HeapByteBuffer.java:49) 06-15 16:26:27.328: E/AndroidRuntime(320): at java.nio.HeapByteBuffer.&lt;init&gt;(HeapByteBuffer.java:41) 06-15 16:26:27.328: E/AndroidRuntime(320): at java.nio.ReadWriteHeapByteBuffer.&lt;init&gt;(ReadWriteHeapByteBuffer.java:43) 06-15 16:26:27.328: E/AndroidRuntime(320): at java.nio.BufferFactory.newByteBuffer(BufferFactory.java:38) 06-15 16:26:27.328: E/AndroidRuntime(320): at java.nio.ByteBuffer.wrap(ByteBuffer.java:82) 06-15 16:26:27.328: E/AndroidRuntime(320): at java.nio.charset.CharsetEncoder.isLegalReplacement(CharsetEncoder.java:646) 06-15 16:26:27.328: E/AndroidRuntime(320): at java.nio.charset.CharsetEncoder.replaceWith(CharsetEncoder.java:752) 06-15 16:26:27.328: E/AndroidRuntime(320): at java.nio.charset.CharsetEncoder.&lt;init&gt;(CharsetEncoder.java:184) 06-15 16:26:27.328: E/AndroidRuntime(320): at com.ibm.icu4jni.charset.CharsetEncoderICU.&lt;init&gt;(CharsetEncoderICU.java:75) 06-15 16:26:27.328: E/AndroidRuntime(320): at com.ibm.icu4jni.charset.CharsetICU.newEncoder(CharsetICU.java:74) 06-15 16:26:27.328: E/AndroidRuntime(320): at java.nio.charset.Charset.encode(Charset.java:692) 06-15 16:26:27.328: E/AndroidRuntime(320): at java.nio.charset.Charset.encode(Charset.java:713) 06-15 16:26:27.328: E/AndroidRuntime(320): at java.io.File.newCString(File.java:214) 06-15 16:26:27.328: E/AndroidRuntime(320): at java.io.File.init(File.java:205) 06-15 16:26:27.328: E/AndroidRuntime(320): at java.io.File.&lt;init&gt;(File.java:175) 06-15 16:26:27.328: E/AndroidRuntime(320): at java.io.File.&lt;init&gt;(File.java:142) 06-15 16:26:27.328: E/AndroidRuntime(320): at com.experts.IVScreen.Databasecreation.createDirIfNotExists(Databasecreation.java:67) 06-15 16:26:27.328: E/AndroidRuntime(320): at com.experts.IVScreen.Databasecreation.getExternalStorageSdCard(Databasecreation.java:34) 06-15 16:26:27.328: E/AndroidRuntime(320): at com.experts.IVScreen.Databasecreation.&lt;init&gt;(Databasecreation.java:21) 06-15 16:26:27.328: E/AndroidRuntime(320): at com.experts.clssfile.GetDetails.&lt;init&gt;(GetDetails.java:19) 06-15 16:26:27.328: E/AndroidRuntime(320): at com.experts.IVScreen.WeekActivity.&lt;init&gt;(WeekActivity.java:22) 06-15 16:26:27.328: E/AndroidRuntime(320): at com.experts.clssfile.GetDetails.&lt;init&gt;(GetDetails.java:20) 06-15 16:26:27.328: E/AndroidRuntime(320): at com.experts.IVScreen.WeekActivity.&lt;init&gt;(WeekActivity.java:22) 06-15 16:26:27.328: E/AndroidRuntime(320): at com.experts.clssfile.GetDetails.&lt;init&gt;(GetDetails.java:20) </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload