{"id":6424,"date":"2014-04-17T23:26:15","date_gmt":"2014-04-17T23:26:15","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/04\/17\/problem-about-back-collection-of-common-programming-errors\/"},"modified":"2014-04-17T23:26:15","modified_gmt":"2014-04-17T23:26:15","slug":"problem-about-back-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/04\/17\/problem-about-back-collection-of-common-programming-errors\/","title":{"rendered":"problem about back-Collection of common programming errors"},"content":{"rendered":"<ul>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/0b7e1bc91b8ab1cbc3e53804a3aba6cf?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nmerrill<br \/>\nlistview button activity back<br \/>\nI have a mainActivity which is Customer.java with listview of 5 diff. activities. I was able to open all 5 activities when I tap them but when i press back button(the device backbutton) to go back to the mainAcitivity it would give me an error which you will see debug\/logcat below the codes. I have post 2 examples activity below my main screen (logout and clockin) . Bonus: As one extra thing I would like to have is when click of the &#8216;clockinActivity&#8217; button i want it to send the current time &amp;am<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/622326349534fe4bd054e8d43040a1d5?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nGrayFox<br \/>\nandroid xml android-layout button back<br \/>\nI can&#8217;t find a way how to make it work. So here it goes:Application starts and I press Option menu and it offers me &#8220;Settings&#8221; option, and when I click it, it goes to layout called &#8220;help.xml&#8221; which shows me some text &#8230;And in that layout I created a button which must return me to my activity ( the window which is shown when app starts) I tried making a back button works but I failed cause I need for user to wait 30 seconds until the next image switch , and by making back button works hw would e<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/c1a86243d5dd3bcae97242b3d3fe5a79?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nuser2603628<br \/>\nsafari websocket back<br \/>\nIf I open a page in Safari for examplehttp:\/\/stackoverflow.comthen open the safari console and open a websocket, for example:var ws = new WebSocket(&#8220;ws:\/\/ws.dslreports.com&#8221;)then I click a link on the page, and then press BACK the back cache is now ignored and the page is reloaded. I observe this on Safari 5.0 (which first introduced hixie websocket support) and latest Safari 6.x which uses hybi. Chrome and Firefox and other browsers supporting websockets do not seem to invalidate the back cache<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/da9532dd1577524cf26b1c808ecfb888?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nuser1001635<br \/>\nandroid listview view back<br \/>\nhi guys after i call the method onKeyDown and my app closes without get me back error, this my code:public boolean onKeyDown(int keyCode, KeyEvent event) {if (keyCode == KeyEvent.KEYCODE_BACK) {if (expList.getVisibility() == View.VISIBLE){expList.setVisibility(View.INVISIBLE);}else{\/\/}}return super.onKeyDown(keyCode, event); }<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/34623a94a05a1894d74cd4c9898a24ed?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nuser2337114<br \/>\nandroid camera back<br \/>\nI have a problem. I want execute example app from http:\/\/www.vogella.com\/articles\/AndroidCamera\/article.html It works. But when change in code CAMERA_FACING_FRONT to CAMERA_FACING_BACK I see in LogCat: Camera Error -1I execute it on my Samsung Galaxy SII private int findFrontFacingCamera() { int cameraId = -1; \/\/ Search for the front facing camera int numberOfCameras = Camera.getNumberOfCameras(); for (int i = 0; i &lt; numberOfCameras; i++) {CameraInfo info = new CameraInfo();Camera.getCameraI<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/i.stack.imgur.com\/LHy12.jpg?s=32&amp;g=1\" \/><br \/>\nAvadhani Y<br \/>\nandroid textview back<br \/>\ni want to set runtime background in textview in android here you can see i have a one image which is runtime set this is not fix so i want to change runtime background in textview and current location in text with different colorholder.textmenu.setBackgroundDrawable(R.Drawable.imagename) \/\/ gives errorholder.textmenu.setBackgroundColor(R.color.color_orange);`<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/7c9870fcb434551ab11f1191c758051a?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nBarney<br \/>\nandroid memory android-activity back<br \/>\nI want, when I press the back button on one of my activities, to go back to the previous activity but before that I need to delete all bitmaps and other resources in memory first otherwise I get an outofmemory error.I tried:public void onBackPressed() {bitmap.recycle();System.gc();Runtime.getRuntime().gc();Intent intent = new Intent(this,GameActivity.class);this.startActivity(intent); }But still have the outofmemory error with that.<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/cd37cdbaf982c903489c7403b36d12e5?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\ntheisenp<br \/>\nandroid stack hashmap back fragment<br \/>\nIn my application I have one Activity, which consists of an overlaying side panel (navigation menu) and a LinearLayout, which is my main layout. I do transactions on my layout and replace fragments inside. I&#8217;m only allowing the user to navigate forward so I do not use a backstack at all. Instead, I use a Hashmap (a pseudo-cache) to keep the fragment instances in memory as the user navigates forward in the menu. The only problem with this approach is that I keep getting a crash when I try to<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/03bdf23b59e23cfd6e479e4b0ba1eb35?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nDan James Palmer<br \/>\nios6 uiviewcontroller uinavigationcontroller exc-bad-access back<br \/>\nI am getting a EXC_BAD_ACCESS(code=1, address=0x0) error (the address equals is another not 0x0 but I assume a number related to my project).This error occurs when going &#8220;back&#8221; to the main VC in a Navigation Controller system. The set up is as follows:View Controller &#8211; MyConnection is the main ViewController. There are tableviewcells and a tab bar on this VC. The tableviewcells will take you to either the Choose Server VC or the Choose Test Type VC. The one button on the tab bar takes you to Pre<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/425a3c143b6649c178e7547aeb4c0b49?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nie.<br \/>\nwindows-phone-7 exception back<br \/>\nOn Wp7 when the user presses the Start button on a page when the phone keyboard is displayed and hits device back button the app crashes with Exception as :-The parameter is incorrect. at MS.Internal.XcpImports.MethodEx(IntPtr ptr, String name, CValue[] cvData)at MS.Internal.XcpImports.MethodPack(IntPtr objectPtr, String methodName, Object[] rawData)at MS.Internal.XcpImports.UIElement_TransformToVisual(UIElement element, UIElement visual)at System.Windows.Controls.SipHelper.AdjustFrame(Framework<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/b97dd3d02ca0ec3d35fcc95a71187550?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nNickLH<br \/>\nandroid activity back<br \/>\nOk my game starts with 2 buttons: One is the new game with this code:case R.id.newgame:openNewGameDialog();break;private void openNewGameDialog() {new AlertDialog.Builder(this).setTitle(&#8220;new game&#8221;).setItems(R.array.difficulty,new DialogInterface.OnClickListener() {public void onClick(DialogInterface dialoginterface,int i) {startGame(i);}}).show(); }private void startGame(int i) {Log.d(TAG, &#8220;clicked on &#8221; + i);Intent intent = new Intent(SudokuActivity.this, Game.class);startActivity(intent);intent<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/2b65ffbed69ff64c3a5212b8840fc0c8?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nJames<br \/>\nandroid webview expandablelistview back tabview<br \/>\nOkay so my App has a Tabview with 3 tabs. Two of my tabs I have no issues with. The first just opens a webview, which works, the third shows a series of picture buttons which in turn open pages that have options, and it works fine. My second is the issue. It has an Expandable List View with 4 parents and varying number of children per parent. I have the Expandable List View working, and each child opens a different page in a webview. This part is working just fine. The problem comes in once I op<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/03bdf23b59e23cfd6e479e4b0ba1eb35?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nDan James Palmer<br \/>\nios6 uiviewcontroller uinavigationcontroller push back<br \/>\nBelow is the hierarchy in question.The &#8220;ViewController &#8211; MyConnection&#8221; in the top left is my main ViewController. I implement a NavigationController system. From the main VC a user can go to the &#8220;Choose Server VC&#8221; or the &#8220;Choose Test Type&#8221; VC using Push. Having done that a user can then press back and return to the main VC, no problem.A user can also Push to the &#8220;Preferences&#8221; VC from the main VC. From the prefences VC a user can also go to the &#8220;Choose Server VC&#8221; or the &#8220;Choose Test Type&#8221; VC, aga<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/38a184962e6edff16aa8760bfb654a0b?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nlansher1985<br \/>\nandroid tabbar back activitygroup<br \/>\nevery one!One year ago, I have developed an application with the combination &#8220;ActivityGroup + TabWidget&#8221;, it works well on android os 2.3+. But I tested it on os 4.0, and I found it crash sometimes. &#8211; If I open application, I do nothing, and i hit &#8220;back&#8221;, it works well. &#8211; If I open application, navigate in the application (click on list item, see detail item then go back), and then when I am back to the &#8220;root&#8221; page of a tab, i click &#8220;back&#8221;, it crash. (It should close the application normally) &#8211;<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/f00a837081a15224f451f6abd03fcc5f?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\ngeebee<br \/>\niphone uitableviewcell crash scroll back<br \/>\nWhen I scroll my table view fast (with a long and quick gesture) so it will scroll for a few seconds more on screen displaying my cells (let&#8217;s say 3-4 seconds) &#8211; and so very quickly I hit the back button to go back to the previous screen: it works&#8230; BUT then the scrolling would have come to a stop (on the screen that I cannot see anymore &#8211; so 3-4 seconds later): the app crashes! and that each time I do that &#8220;fancy&#8221; crash test.I used my own table view cells &#8211; and I am a bit out of ideas of where<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/c3eca22bd5476931e4768dea076bd4ce?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nrptwsthi<br \/>\nios crash exc-bad-access back<br \/>\nThe app crashes and shows this error when I hit the Back button. I have 2 view controllers. On the first vc the Start button works fine to switch to second view, but when I hit the Back button the app crashes and I get the error above on the line below @autorelease pool. I will also post the code for my start &amp; back buttons. thx :)#import #import &#8220;AppDelegate.h&#8221;int main(int argc, char *argv[]) {@autoreleasepool {return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate cl<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/0dd63abb759f33b4f65b672662b3b7d6?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\njigar<br \/>\nandroid android-intent bundle back<br \/>\nI have made a simple android program with two activities,in that 1st activity contains some edittexts and a button,and second activity contain same number of textviews.Now when the button in 1st activity pressed the text from Edittexts should go to 2nd activity&#8217;s textViews.I have tried code as below,but it&#8217;s not working:MainActivity.javapackage com.example.myweb;import android.os.Bundle; import android.app.Activity; import android.content.Intent; import android.view.Menu; import android.view.Vie<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/3f1ab37cdb8eb9427759cb946f3a5a34?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nHosni<br \/>\nandroid activity back<br \/>\nI am trying to get a quiet simple activity to work.my activity includes two buttons, and i am trying to make one of them work as a simple back button (go back to previous activity) any help?here is my code:public void valider(View v) {c.setNomPrenom(et1.getText().toString());c.setmPortable(et2.getText().toString());c.setmFixe(et3.getText().toString());i.putExtra(ContactActivity.TAG_AJOUT_EDIT, c);setResult(RESULT_OK,i);finish(); }@Override public void onBackPressed() {super.onBackPressed(); }pub<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/61b03524f85f8a654f9088fa879b17c7?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nunor<br \/>\nforms browser https back<br \/>\nEnter\/change something in a textarea Before submitting the form, leave the page (e.g. by clicking browser&#8217;s back button) Go back to the edit page (e.g. by clicking the forward button)Expected result: the content entered in the textarea should still be thereActual result: with HTTPS: all changes are gone (bad!) with HTTP: the changes are still there (good!)Why is this happening when using HTTPS? How can I prevent this? Is the browser or the website responsible?<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/9166168e2a7ae9ad81eb46019ab6df75?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nQLiu<br \/>\najax call back<br \/>\nI have an Ajax call back function which call to a PHP function check the file modified time. I uses timer to execute it every 50 seconds.&lt;script type=&#8221;text\/javascript&#8221;&gt;setInterval(&#8220;_checkPopUpUpdate()&#8221;, 50000); \/\/50 seconds&lt;\/script&gt;function _checkPopUpUpdate(){var callback=new Object();callback.success=this.onExternalSuccess;callback.failure=this.onExternalFailure;YAHOO.util.Connect.asyncRequest(&#8216;GET&#8217;,&#8217;\/ci\/ajaxCustom\/ajaxCheckPopupUpdate&#8217;,callback); };The PHP function checks whether<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/9166168e2a7ae9ad81eb46019ab6df75?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nQLiu<br \/>\najax popup call back<br \/>\nI have an Ajax callback function, which will load a html file and pop up the content of this HTMl file in a pop up window. It works so far, however, i want to get rid of the location bar in the pop up window. Here is my code function _checkPopUpUpdate() {var callback=new Object();callback.success=this.onExternalSuccess;callback.failure=this.onExternalFailure;YAHOO.util.Connect.asyncRequest(&#8216;GET&#8217;,&#8217;\/ci\/ajaxCustom\/ajaxCheckPopupUpdate&#8217;,callback);};function onExternalSuccess (o){if(o.responseText!=<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/i.stack.imgur.com\/gQIJK.jpg?s=32&amp;g=1\" \/><br \/>\nXYZ_Allen<br \/>\njavascript html dom back browser-history<br \/>\nim testing a method that include simple javascript to switch different contents instead of linking to other pages. However the problem is if i do this, the browser actually renders all &#8220;pages&#8221; but only show part content of it. therefore its no history but only different url followed by. I tried use goback(-1) won&#8217;t work. Haven&#8217;t try document.referrer. So the question is there a way that can store history and add it to browser? I checked the history is read-only, but i can make go back button<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/5d16339e410de2d3fac40826aabd6cf5?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nZachary<br \/>\nbutton layout webview back<br \/>\nAs part of an app I am creating, I am trying to make little push buttons go to web pages. I&#8217;ve been using webview for such, but an having some trouble configuring the back buttonMy Current Code so Far For One Button:public class MainActivity extends Activity implements View.OnClickListener{@Override public void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.activity_main); }public void onClick(View v){}public void tip1 (View v){WebView mWebView;se<\/li>\n<\/ul>\n<p>Web site is in building<\/p>\n","protected":false},"excerpt":{"rendered":"<p>merrill listview button activity back I have a mainActivity which is Customer.java with listview of 5 diff. activities. I was able to open all 5 activities when I tap them but when i press back button(the device backbutton) to go back to the mainAcitivity it would give me an error which you will see debug\/logcat [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-6424","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/6424","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=6424"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/6424\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=6424"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=6424"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=6424"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}