java,android,listview,crash,listactivity , Application Crashes when an Activity that Extends ListView is 'Launched'


Application Crashes when an Activity that Extends ListView is 'Launched'

Question:

Tag: java,android,listview,crash,listactivity

Here is my InfoBookActivity.java

package thesleeplesselite.drgreenthumb;

import android.app.ListActivity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;

public class InfoBookActivity extends ListActivity {

    // -- AUTO-GENERATED CODE --

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

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.menu_infobook, 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();

        // noinspection SimplifiableIfStatement
        if (id == R.id.action_settings) {
            return true;
        }

        return super.onOptionsItemSelected(item);
    }

    // -- END OF AUTO-GENERATED CODE --
}

I want to set it using a custom layout and this is the code for my xml:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:orientation="vertical"
    android:layout_width="match_parent"
    android:layout_height="match_parent" android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    android:paddingBottom="@dimen/activity_vertical_margin"
    tools:context="thesleeplesselite.drgreenthumb.InfoBookActivity"
    android:background="#6E5E63"
    android:id="@+id/linearLayoutVertical"
    android:focusableInTouchMode="false">

    <LinearLayout
        android:orientation="horizontal"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:id="@+id/linearLayoutHorizontal"
        android:gravity="center_vertical"
        android:weightSum="1"
        android:layout_marginBottom="5dp">

        <ImageView
            android:layout_width="35dp"
            android:layout_height="35dp"
            android:id="@+id/imgIconSearch"
            android:src="@drawable/icon_search"
            android:contentDescription="@string/str_imgIconSearch"
            android:layout_marginRight="10dp"
            android:layout_weight="0.01"/>

        <EditText
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:id="@+id/txtEIBSearchBar"
            android:layout_weight="0.99"
            android:inputType="text"
            android:hint="@string/str_txtEIBSearchBar"
            android:textColorHint="#E8CDBC"
            android:textColor="#E8CDBC" />
    </LinearLayout>

    <ListView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:id="@+id/list"
        android:background="#EDE5DA" />

</LinearLayout>

And here's my logcat:

06-16 03:35:29.180    2593-2601/? E/art﹕ Thread attaching while runtime is shutting down: Binder_1
06-16 03:35:29.180    2593-2601/? I/AndroidRuntime﹕ NOTE: attach of thread 'Binder_1' failed
06-16 03:35:29.195      945-945/? I/art﹕ Background concurrent mark sweep GC freed 785(33KB) AllocSpace objects, 0(0B) LOS objects, 91% free, 93KB/1117KB, paused 5.193ms total 20.045ms
06-16 03:35:29.207    1242-2223/? I/ActivityManager﹕ Start proc 2602:thesleeplesselite.drgreenthumb/u0a58 for activity thesleeplesselite.drgreenthumb/.MainActivity
06-16 03:35:29.221    2602-2602/? I/art﹕ Not late-enabling -Xcheck:jni (already on)
06-16 03:35:29.736    2602-2614/? I/art﹕ Background sticky concurrent mark sweep GC freed 2740(227KB) AllocSpace objects, 0(0B) LOS objects, 0% free, 7MB/7MB, paused 92.395ms total 130.649ms
06-16 03:35:29.848    2602-2617/? D/OpenGLRenderer﹕ Use EGL_SWAP_BEHAVIOR_PRESERVED: true
06-16 03:35:29.852    2602-2602/? D/﹕ HostConnection::get() New Host Connection established 0xb42b3e60, tid 2602
06-16 03:35:29.940    2602-2602/? D/Atlas﹕ Validating map...
06-16 03:35:29.942    1242-1591/? V/WindowManager﹕ Adding window Window{3d9b73de u0 thesleeplesselite.drgreenthumb/thesleeplesselite.drgreenthumb.MainActivity} at 2 of 8 (before Window{c47461d u0 Starting thesleeplesselite.drgreenthumb})
06-16 03:35:30.076    2602-2617/? D/﹕ HostConnection::get() New Host Connection established 0xb43f5090, tid 2617
06-16 03:35:30.193    2602-2617/? I/OpenGLRenderer﹕ Initialized EGL, version 1.4
06-16 03:35:30.240    2602-2617/? D/OpenGLRenderer﹕ Enabling debug mode 0
06-16 03:35:30.280    2602-2617/? W/EGL_emulation﹕ eglSurfaceAttrib not implemented
06-16 03:35:30.280    2602-2617/? W/OpenGLRenderer﹕ Failed to set EGL_SWAP_BEHAVIOR on surface 0xb43891e0, error=EGL_SUCCESS
06-16 03:35:30.929    1242-1265/? I/Choreographer﹕ Skipped 97 frames!  The application may be doing too much work on its main thread.
06-16 03:35:31.885    2602-2602/? I/Choreographer﹕ Skipped 90 frames!  The application may be doing too much work on its main thread.
06-16 03:35:31.904    1242-1265/? I/ActivityManager﹕ Displayed thesleeplesselite.drgreenthumb/.MainActivity: +2s731ms (total +6m57s110ms)
06-16 03:35:32.759    1242-1300/? D/TaskPersister﹕ removeObsoleteFile: deleting file=66_task.xml
06-16 03:39:59.597    1242-1334/? D/ConnectivityService﹕ reportBadNetwork(NetworkAgentInfo [MOBILE (UMTS) - 100]) by 10007
06-16 03:39:59.597    1242-1626/? D/NetworkMonitor/NetworkAgentInfo [MOBILE (UMTS) - 100]﹕ ValidatedState{ when=-1ms what=532488 arg1=10007 target=com.android.internal.util.StateMachine$SmHandler }
06-16 03:39:59.597    1242-1626/? D/NetworkMonitor/NetworkAgentInfo [MOBILE (UMTS) - 100]﹕ DefaultState{ when=-1ms what=532488 arg1=10007 target=com.android.internal.util.StateMachine$SmHandler }
06-16 03:39:59.597    1242-1626/? D/NetworkMonitor/NetworkAgentInfo [MOBILE (UMTS) - 100]﹕ Forcing reevaluation
06-16 03:39:59.598    1242-1626/? D/NetworkMonitor/NetworkAgentInfo [MOBILE (UMTS) - 100]﹕ EvaluatingState{ when=0 what=532486 arg1=15 target=com.android.internal.util.StateMachine$SmHandler }
06-16 03:39:59.598    1242-1626/? D/NetworkMonitor/NetworkAgentInfo [MOBILE (UMTS) - 100]﹕ Checking http://connectivitycheck.android.com/generate_204 on epc.tmobile.com
06-16 03:39:59.689    1242-1626/? D/NetworkMonitor/NetworkAgentInfo [MOBILE (UMTS) - 100]﹕ isCaptivePortal: ret=204 headers={null=[HTTP/1.1 204 No Content], Content-Length=[0], Date=[Mon, 15 Jun 2015 19:46:35 GMT], Server=[GFE/2.0], X-Android-Received-Millis=[1434397199689], X-Android-Response-Source=[NETWORK 204], X-Android-Sent-Millis=[1434397199656]}
06-16 03:39:59.689    1242-1626/? D/NetworkMonitor/NetworkAgentInfo [MOBILE (UMTS) - 100]﹕ Don't send network conditions - lacking user consent.
06-16 03:39:59.689    1242-1626/? D/NetworkMonitor/NetworkAgentInfo [MOBILE (UMTS) - 100]﹕ Validated
06-16 03:39:59.690    1242-1286/? D/ConnectivityService﹕ setProvNotificationVisibleIntent: E visible=false networkType=0 extraInfo=null
06-16 03:39:59.690    1242-1286/? D/ConnectivityService﹕ Validated NetworkAgentInfo [MOBILE (UMTS) - 100]
06-16 03:40:04.999    1667-2623/? D/GCM﹕ Connected
06-16 03:40:05.047    1667-2623/? D/GCM﹕ Message class com.google.e.a.a.q
06-16 03:41:25.432    1242-2221/? I/ActivityManager﹕ START u0 {cmp=thesleeplesselite.drgreenthumb/.InfoBookActivity} from uid 10058 on display 0
06-16 03:41:25.434    1242-2221/? V/WindowManager﹕ addAppToken: AppWindowToken{1f619242 token=Token{3ceaf08d ActivityRecord{1bdefd24 u0 thesleeplesselite.drgreenthumb/.InfoBookActivity t67}}} to stack=1 task=67 at 1
06-16 03:41:25.440    1242-1290/? W/AudioTrack﹕ AUDIO_OUTPUT_FLAG_FAST denied by client
06-16 03:41:25.599    2602-2602/? D/AndroidRuntime﹕ Shutting down VM
    --------- beginning of crash
06-16 03:41:25.600    2602-2602/? E/AndroidRuntime﹕ FATAL EXCEPTION: main
    Process: thesleeplesselite.drgreenthumb, PID: 2602
    java.lang.RuntimeException: Unable to start activity ComponentInfo{thesleeplesselite.drgreenthumb/thesleeplesselite.drgreenthumb.InfoBookActivity}: java.lang.RuntimeException: Your content must have a ListView whose id attribute is 'android.R.id.list'
            at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2325)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2390)
            at android.app.ActivityThread.access$800(ActivityThread.java:151)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303)
            at android.os.Handler.dispatchMessage(Handler.java:102)
            at android.os.Looper.loop(Looper.java:135)
            at android.app.ActivityThread.main(ActivityThread.java:5257)
            at java.lang.reflect.Method.invoke(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:372)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
     Caused by: java.lang.RuntimeException: Your content must have a ListView whose id attribute is 'android.R.id.list'
            at android.app.ListActivity.onContentChanged(ListActivity.java:243)
            at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:382)
            at android.app.Activity.setContentView(Activity.java:2145)
            at thesleeplesselite.drgreenthumb.InfoBookActivity.onCreate(InfoBookActivity.java:16)
            at android.app.Activity.performCreate(Activity.java:5990)
            at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106)
            at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2278)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2390)
            at android.app.ActivityThread.access$800(ActivityThread.java:151)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303)
            at android.os.Handler.dispatchMessage(Handler.java:102)
            at android.os.Looper.loop(Looper.java:135)
            at android.app.ActivityThread.main(ActivityThread.java:5257)
            at java.lang.reflect.Method.invoke(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:372)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
06-16 03:41:25.657    1242-2222/? W/ActivityManager﹕ Force finishing activity 1 thesleeplesselite.drgreenthumb/.InfoBookActivity
06-16 03:41:25.672    1242-2222/? W/ActivityManager﹕ Force finishing activity 2 thesleeplesselite.drgreenthumb/.MainActivity
06-16 03:41:25.830    1242-2499/? I/OpenGLRenderer﹕ Initialized EGL, version 1.4
06-16 03:41:25.936    1242-2499/? W/EGL_emulation﹕ eglSurfaceAttrib not implemented
06-16 03:41:25.936    1242-2499/? W/OpenGLRenderer﹕ Failed to set EGL_SWAP_BEHAVIOR on surface 0xa2046500, error=EGL_SUCCESS
06-16 03:41:26.320    1242-1260/? W/ActivityManager﹕ Activity pause timeout for ActivityRecord{1bdefd24 u0 thesleeplesselite.drgreenthumb/.InfoBookActivity t67 f}
06-16 03:41:26.405    1463-1612/? I/OpenGLRenderer﹕ Initialized EGL, version 1.4
06-16 03:41:26.482    1463-1612/? W/EGL_emulation﹕ eglSurfaceAttrib not implemented
06-16 03:41:26.482    1463-1612/? W/OpenGLRenderer﹕ Failed to set EGL_SWAP_BEHAVIOR on surface 0xa5a04380, error=EGL_SUCCESS
06-16 03:41:26.751    1463-1478/? I/art﹕ Background sticky concurrent mark sweep GC freed 2635(114KB) AllocSpace objects, 2(33KB) LOS objects, 0% free, 20MB/20MB, paused 13.027ms total 45.840ms
06-16 03:41:27.046    1463-1478/? I/art﹕ Background partial concurrent mark sweep GC freed 7650(606KB) AllocSpace objects, 30(7MB) LOS objects, 22% free, 13MB/17MB, paused 2.534ms total 146.769ms
06-16 03:41:27.357    1317-1317/? W/ResourceType﹕ No package identifier when getting value for resource number 0x00000000
06-16 03:41:27.357    1317-1317/? W/PackageManager﹕ Failure retrieving resources for thesleeplesselite.drgreenthumb: Resource ID #0x0
06-16 03:41:27.472    1463-1478/? I/art﹕ Background sticky concurrent mark sweep GC freed 285(36KB) AllocSpace objects, 6(124KB) LOS objects, 3% free, 17MB/17MB, paused 22.838ms total 66.592ms
06-16 03:41:29.182    1242-1290/? W/AudioTrack﹕ AUDIO_OUTPUT_FLAG_FAST denied by client
06-16 03:41:29.205    2602-2602/? I/Process﹕ Sending signal. PID: 2602 SIG: 9
06-16 03:41:29.240    1242-1275/? W/InputDispatcher﹕ channel '3d9b73de thesleeplesselite.drgreenthumb/thesleeplesselite.drgreenthumb.MainActivity (server)' ~ Consumer closed input channel or an error occurred.  events=0x9
06-16 03:41:29.240    1242-1275/? E/InputDispatcher﹕ channel '3d9b73de thesleeplesselite.drgreenthumb/thesleeplesselite.drgreenthumb.MainActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
06-16 03:41:29.241    1242-2499/? D/OpenGLRenderer﹕ endAllStagingAnimators on 0x9e152d00 (RippleDrawable) with handle 0xa2363ab0
06-16 03:41:29.247    1242-2220/? E/JavaBinder﹕ !!! FAILED BINDER TRANSACTION !!!
06-16 03:41:29.248    1242-2220/? W/InputMethodManagerService﹕ Got RemoteException sending setActive(false) notification to pid 2602 uid 10058
06-16 03:41:29.248    1242-2220/? E/JavaBinder﹕ !!! FAILED BINDER TRANSACTION !!!
06-16 03:41:29.280    1242-1585/? I/ActivityManager﹕ Process thesleeplesselite.drgreenthumb (pid 2602) has died
06-16 03:41:29.281    1242-2223/? I/WindowState﹕ WIN DEATH: Window{3d9b73de u0 thesleeplesselite.drgreenthumb/thesleeplesselite.drgreenthumb.MainActivity}
06-16 03:41:29.281    1242-2223/? W/InputDispatcher﹕ Attempted to unregister already unregistered input channel '3d9b73de thesleeplesselite.drgreenthumb/thesleeplesselite.drgreenthumb.MainActivity (server)'
06-16 03:41:29.798    1463-1612/? W/OpenGLRenderer﹕ Incorrectly called buildLayer on View: ShortcutAndWidgetContainer, destroying layer...

I don't understand? I think I've already named my ListView 'list', as stated in my xml file.

I'm new to this Android thing, so maybe a noob-friendly explanation would help. Thank you.


Answer:

The key is this from your stack trace:

Your content must have a ListView whose id attribute is 'android.R.id.list'

Your ListView in the xml layout needs the following id:

<ListView
  android:id="@android:id/list"

(notice its not @+/id)


Related:


How to call MySQL view in Struts2 or Hibernate


java,mysql,hibernate,java-ee,struts2
I have a view in MySQL database CREATE VIEW CustInfo AS SELECT a.custName, a.custMobile, b.profession, b.companyName, b.annualIncome FROM customer a INNER JOIN cust_proffessional_info b ON a.cust_id=b.cust_id Is there any way that i can call this view using Struts2 or in Hibernate. I have tried to search it but could not...

Android programming, draw a rectangle with specific coordinates


android
I am new to android programming. I am trying to draw a rectangle as in the image below. I have no idea how to do it with Rect(int left, int top, int right, int bottom). Can someone help me with this thanks. ...

BitmapFont class does not have getBound(String) method


java,android,libgdx
Previously I used getBound method for BitmapFont class in libgdx, but now, I am unable to use it. I cannot find the changes in latest version. Any help is appreciated. Thank you...

Javadoc: Do parameter and return need an explicit type description


java,types,javadoc
When Javadoc'ing, I don't know whether you should explicitly say whether the parameters are of type String or int. For example /** * This method does something * @param foo an object of type Foo * @param abc the number of doors, of type int * @return the number of...

PropertyNotFoundException in jsp


java,jsp
Am getting this error in my application javax.el.PropertyNotFoundException: Property 'survey_id' not found on type com.moh.forms.MOH731 javax.el.BeanELResolver$BeanProperties.get(BeanELResolver.java:229) javax.el.BeanELResolver$BeanProperties.access$400(BeanELResolver.java:206) javax.el.BeanELResolver.property(BeanELResolver.java:317) javax.el.BeanELResolver.getValue(BeanELResolver.java:85) This is my MOH731.java @Id @GeneratedValue(strategy = GenerationType.AUTO) private int survey_id; public MOH731 (int survey_id, String uname)...

Get network interfaces on remote machine


java,network-programming
I know in java we can do NetworkInterface.getNetworkInterfaces() to get all available network interfaces on local machine. Can we do similar thing where I can pass host name to get the NICs(with IPs) which are up and running?

Interpreting hex dump of java class file


java,class,hex
I understand the structure of a java .class file, but when I want to interpret the raw hex data I get a bit lost. This is a hex dump of a class file, excluding the header and constant pool. I understand the header to be the magic number, minor_version and...

Android String if-statement


java,android,string
I have a if-statement in the start of my app if (ready.equals("yes")){ ... } and later on my code I have ready="yes"; but the if statement is never called, why? The ready="yes"; is called from a background thread, is that why? public void DownloadFromUrl(final String fileName) { //this is the...

Mysterious claim of a missing { in eclipse


java,eclipse
I have a case of a mysterious missing curly brace that I don't see any use for. Eclipse says, "Syntax error on token ";", { expected after this token". Either I am missing something very silly or there is something new I have to learn about Java. This is the...

Using world coordinates


java,libgdx
I am currently using pixels as units for placing objects within my world, however this can get tedious because I only ever place objects every 16 pixels. For example, I would like to be able to place an object at position 2 and have the object rendered at the pixel...

Problems implementing ViewHolder pattern


android,design-patterns
I'm working on an android app from a book. I'm getting errors : "crimeHolder cannot be resolved" and I can't understand why.. public View getView(int poisition, View convertView , ViewGroup parent) { //If we weren't given a view, inflate one if (convertView == null) { convertView = getActivity().getLayoutInflater().inflate(R.layout.list_item_crime, null); ViewHolder...

Android set clickable text to go one fragment to another fragment


java,android,android-fragments,spannablestring
I need to do something like this. Suppose I have 2 fragments A and B.There is a text which can be clickable in fragment A and when user click this text , he can go to fragment B. This example helped me to do it but I think it does...

why is Android app publishing taking several days [on hold]


android,google-play,publishing
I have uploaded my app on the store 3 days ago and it status still : PENDING PUBLICATION I have uploaded all the app listing needed : description, screen shots ... and google didn't contact me on E-mail. does anyone had the same case before ???...

how does android ImageView resize my image?


android
I have some 100*100 icons and I cannot find better resolution icons so I put them inside drawable folder. The width and height of the image view are set to wrap_content. When the image is shown on a xhdpi screen will the image be scaled to 200*200 automatically? or should...

Is there any way to use a pre-existing database from Xamarin without copying it from Assets?


android,xamarin,xamarin.forms
I have a rather large SQLite database (~20 mb) I need to access from my Android Xamarin-Forms app. Everything online I've read says you can read the database by copying it to the filesystem first. For example, this question. However, won't that mean the large database is duplicated, wasting users'...

viewResolver with more folders inside of WEB-INF/jsp is not working in spring


java,spring,jsp,spring-mvc
<bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver"> <property name="viewClass" value="org.springframework.web.servlet.view.JstlView" /> <!-- avoid '???' --> <property name="prefix" value="/WEB-INF/jsp/" /> <property name="suffix" value=".jsp"/> </bean> if i create other subfolders under jsp , for instance /WEB-INF/jsp/reports , /WEB-INF/jsp/insertions how should i configure now the viewResolver to can resolve these new sub folders??...

Dagger 2 Custom Scope for each Fragment


android,android-fragments,dagger-2
I'm a little confused about how to best use the custom scoping in Dagger 2. I've looked at a couple different articles which seem to suggest two different ways of doing it: MVP Presenters that Survive Configuration Changes Part-2 (Github repo): Uses unique custom scopes for each fragment, e.g. @Hello1Scope...

How to resolve Out of Memory Error on Bitmap in Android?


android,android-intent,android-activity,bitmap
I want to set an image in image view,I am retrieving the image path in my first activity and I am passing it via intent as a String to second activity.In the second activity I set the path to an image view,It is working properly , and I need to...

Floating Action Button in Xamarin.Forms


android,xamarin,monodroid,xamarin.forms,floating-action-button
I had completed my App's home page in Xamarin.Forms Portable. Now i want to add a Flotation Action Button In my Android Project ! Is there any way to add FAB for Android in my existing home page, which was coded in Xamarin.Forms Portable. OR I want to create a...

Get document on some condition in elastic search java API


java,elasticsearch,elasticsearch-plugin
As I know we can parse document in elastic search, And when we search for a keyword, It will return the document using this code of java API:- org.elasticsearch.action.search.SearchResponse searchHits = node.client() .prepareSearch() .setIndices("indices") .setQuery(qb) .setFrom(0).setSize(1000) .addHighlightedField("file.filename") .addHighlightedField("content") .addHighlightedField("meta.title") .setHighlighterPreTags("<span class='badge badge-info'>") .setHighlighterPostTags("</span>") .addFields("*", "_source")...

Android Implicit Intent for Viewing a Video File


java,android,android-intent,uri,avd
In my Android app, I have a button that when clicked, launches the external application of my choice to play a video (I gather that this is called an "implicit intent"). Here is the relevant Java code from my onCreate method. Button button = (Button) findViewById(R.id.button); button.setOnClickListener ( new Button.OnClickListener()...

Keep HashMap with object data while app is idle - Android


android,android-activity
I have a HashMap that contains data relevant to a specific Activity. The problem is that when the app is opened after being idle for some time, the HashMap is empty. I am fetching all the data in the main activity and storing the corresponding objects in a HashMap in...

Set value for Spinner with custom Adapter in Android


android,dynamic,android-arrayadapter,android-spinner
I am developing a android application with spinner in a form. The spinner items and spinner values are different. I want to collect all the value from the from including spinner and set a rest api service to web back end. here is the response array. {"Status":true,"errorType":null,"countryList":[{"Code":"US","Name":"United States"},{"Code":"CA","Name":"Canada"},{"Code":"AU","Name":"Australia"},{"Code":"GB","Name":"United Kingdom"}]} I...

Android custom calendar view disable specific dates


android,calendarview
i'm new to android developing and started to develop an booking app. There is a calendar view and i want to disable booked dates in that calendar. I found out that disabling feature is not there in android default calendar. so could you please help me to find a good...

How to set speaker phone off when the app is killed by the “Recent App drawer”


android,android-audiomanager,ondestroy
I implemented an app which has a button speaker, which is manually set "on" by myAudioManager.setSpeakerphoneOn(true) and "off" vice-versa. But the bug is when you close the application while the speaker is on, it forgets the speaker was on. The next time, the speaker remains on and the call is...

Finding embeded xpaths in a String


java,regex
I have a string where I have the user should be able to specify xpaths that will be evaluated at runtime. I was thinking about having a the following way to specify it. String = "Hi my name is (/message/user) how can i help you with (/message/message) "; How can...

how to call Java method which returns any List from R Language? [on hold]


java,r,rjava
How to call java method which returns list from R Language.

how to add menu items to action bar in more than 30 activities


android,android-activity,android-studio,menu,menuitem
I have created an app in android studio that has more than 30 activities .I created menu items in some activities by adding them in individual menu files and they worked fine . But the problem is that it is a real headache to add all the menu items in...

Twitter4j - cannot resolve method - setUsessl(boolean)


android,android-studio,twitter4j
I'm using twitter4j 4.0.3 core I have this code: public final class TwitterUtil { private RequestToken requestToken = null; private TwitterFactory twitterFactory = null; private Twitter twitter; private TwitterUtil() { ConfigurationBuilder configurationBuilder = new ConfigurationBuilder(); configurationBuilder.setOAuthConsumerKey(ConstantValues.TWITTER_CONSUMER_KEY); configurationBuilder.setOAuthConsumerSecret(ConstantValues.TWITTER_CONSUMER_SECRET); configurationBuilder.setUseSSL(true); Configuration configuration =...

Selenium catch popup on close browser


java,selenium,browser
I'm trying to test that when I close my window a popup shows with a warning message. I've tried both driver.close() and driver.quit() after making sure I'm on the proper window but this just terminates the process since my popup doesn't show. I could test it by using the awt...

Can I install 2 or more Android SDK when using Eclipse


java,android,eclipse,sdk,versions
I am new to android developments. I am setting up my android development environment using Eclipse. I have a test smart phone with Android version 4.2.2. The automatic installation installed the latest Android SDK version, which is 5.1.1. My questions are: 1. Do I have to install the SDK version...

Unfortunately, (My app) has stopped. Eclipse Android [duplicate]


java,android,eclipse,adt
This question already has an answer here: What is a Null Pointer Exception, and how do I fix it? 12 answers I'm a beginner in android developing and I'm trying to build a simple app but I'm getting this error in the emulator.(Unfortunately,(App) has unexpectedly stopped). LogCat http://i.stack.imgur.com/VZhuL.png package...

Join files using Apache Spark / Spark SQL


java,apache-spark,apache-spark-sql
I am trying to use Apache Spark for comparing two different files based on some common field, and get the values from both files and write it as output file. I am using Spark SQL for joining both files (after storing the RDD as table). Is this the correct approach?...

Why i get can not resolve method error in class android?


android,json
I use this tutorial: JSON and part of code to this: protected String doInBackground(String... urls) { TextView lbl=(TextView) findViewById(R.id.provCODE); person = new Person(); person.setName(lbl.getText().toString()); //person.setCountry("1853"); //person.setTwitter("1892"); return POST(urls[0],person); } but in the this line: person.setName(lbl.getText().toString()); i get this error: Can not resolve method. How can i solve that?what happen? my...

type conversion if flex


java,actionscript-3,flex
I am using Flerry as Java-Flex bridge for my Flex Desktop Application. How to convert List in Java to ArrayCollection in Flex Flex Code:- [Bindable]public var screenList:ArrayCollection; <flerry:NativeObject id="windowControllerObj" source="ls.window.EnumAllWindowNames" singleton="true" fault="windowControllerObj_faultHandler(event)"> <flerry:NativeMethod id="getWindowNames" name="getAllWindowNames" result="windowControllerObj_resultHandler(event)" fault="getWindowNames_faultHandler(event)"/>...

Java dice roll with unexpected random number


java,if-statement
I've written a simple Java program to display the results of 20 dice rolls on the console. The results I'm getting are listed below: 3 1 [email protected] 1 5 4 1 [email protected] 1 [email protected] [email protected] 1 6 [email protected] 1 [email protected] [email protected] 1 2 3 3 When I ran it for...

Getting particular view from expandable listview


java,android,listview,android-fragments,expandablelistview
In my list view I have an textview in expandable group and I want to open the dialog when textview is clicked to fill the information through edittext and update textview. Problem: how could I get the groupview textview item in my fragment oncreateview() method....

Fixed element in android?


android,xml,android-fragments
I am using a FAB(Floating action button) and a ViewPager that has a list inside a fragment. The ViewPager stops due to the FAB block and each are blocks the ViewPager being on top of the FAB activity_main.xml <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" xmlns:fab="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" android:fitsSystemWindows="true">...

Java Scanner not reading newLine after wrong input in datatype verification while loop


java,while-loop,java.util.scanner
I've looked at similar questions and tried to follow the answers that solved the issues that others have had but putting the sc.next() or sc.nextLine() after the while loop causes it to go into an infinite loop. The problem is if a user enters incorrect input (nothing or a number)...

Is there any sdk to log exceptions, events and errors in production app?


android,logging,error-handling,sdk,production
I want to catch all the un expected/undesirable events in my app during production. I want something which can send a error log file to server and I can easily read it through a web application. Do you know anything of this sort ?

How can implement long running process in spring hibernate?


java,spring,hibernate
as we know the struts interceptor execute and wait will take care of long running process by not getting the request to timeout and destroy it sends wait and at last the desired response i want to implement the same for long running process in spring and hibernate. Thanks....

Get current latitude and longitude android


java,android,gps,geolocation,location
Requirement: 1.Sometimes(not everytime) I am getting latitude and longitude 0.0. 2.I want to know how to get the location update after user has enabled the gps from the settings. Here is my code public class GPSTracker extends Service implements LocationListener { private final Context mContext; // flag for GPS status...