android,android-fragments,android-imageviewRelated issues-Collection of common programming errors


  • ihsan kocak
    android maven jarsigner
    I am trying to sign my .apk file with maven jarsigner.My pom’s profile part is this:<profile><id>sign</id><build><plugins><plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-jarsigner-plugin</artifactId><version>1.2</version><executions><execution><id>signing</id><goals><goal>sign</goal></goals><phase>package</phase><inherited>true</inherit

  • Bansal_Sneha
    android sip
    I am developing an app using native Sip library available in android . Here is my code package com.example.demosip;import java.text.ParseException;import android.net.sip.SipAudioCall;import android.net.sip.SipException;import android.net.sip.SipManager;import android.net.sip.SipProfile;import android.net.sip.SipRegistrationListener;import android.os.Bundle;import android.os.CountDownTimer;import android.app.Activity;import android.app.PendingIntent;import android.content.Intent;import android.u

  • B. Clay Shannon
    android android-emulator android-intent android-activity
    Admittedly so short a ride that I may as well walk, I am being driven bazonkers by my rather simple (so far) app failing when trying to show the first Activity. It all displayed fine until I added some code to actually make it do something besides look pretty.Perhaps an Android guru will glean a reason from a slew of clues:1) The possibly pertinent errors in LogCat:01-29 19:57:58.168: W/ActivityThread(388): Application com.aXX3AndSpace.OnDemandAndAutomatic_Package is waiting for the debugger on

  • Mj1992
    java android
    1.I was trying to pass an array of string from 1 activity to another but the application is giving “Application Stopped Unexpectedly”.I am new to android and I don’t know how to do it.2.Can you please tell me how to tackle these runtime errors and how to use logcat I’ve noidea?Code Activity A:private OnClickListener mylistener=new OnClickListener() {@Overridepublic void onClick(View arg0) {intent=new Intent(MsgSmsActivity.this,MsgSmsActivity2.class);MsgSmsActivity.this.startActivity(intent);inte

  • tyczj
    android
    I am trying to backup my databases from my app to my sd card but every time I try I get FileNotFoundException and I am not sure why when the name of the database is rightcode to backup databasestry{File dbFile = new File(Environment.getDataDirectory() + “/data/my.app.package/databases/Games.db”);File exportDir = new File(Environment.getExternalStorageDirectory()+”/BCAData”);if (!exportDir.exists()) {exportDir.mkdirs();}File file = new File(exportDir, dbFile.getName());file.createNewFile();FileC

  • Jav_Rock
    java android opencv computer-vision background-subtraction
    I am working on a robotics project using an Android phone as the main processor and the camera to detect movement. I got the Android binary package from OpenCV and got it correctly installed. I can capture images using the OpenCV native camera and display them to the screen. I’m having problems using the background subtraction class, though. I can make a new BackgroundSubtractorMOG object in the constructor, but when I attempt to run the code below, it force quits I get the error “Only 1- and 3-

  • Janusz
    android android-logcat
    I want to print the stack trace because at the moment I have this running.} catch (IOException e) {throw new Error(“Copying Failed”); }And I have been told to print e.stacktrace();How do I do this?

  • gk91
    android android-intent android-sdcard
    I can save only 1 image, this codes saving the last taken image with the same name so old images are deleting automaticly. I should save lots of image to sd card, what should I do for fix this code?protected void onActivityResult(int requestCode, int resultCode, Intent data) {super.onActivityResult(requestCode, resultCode, data);if (requestCode == IMAGE_ACTION_CODE) {// 2Bitmap thumbnail = (Bitmap) data.getExtras().get(“data”);imagev.setImageBitmap(thumbnail);// 3ByteArrayOutputStream bytes = ne

  • Pranav
    android android-ndk jni
    I am a little stuck with this one… ReferenceTable overflow (max=512), I am sure it has to do with the Number of Local References getting created in my native method call… To work around the issue I have even tried to remove the local references from the native call; but still I am unable to solve the problem… I am passing a 2D Array; which is approaximately 1024 X 1024 …Here is the error trace I am referring to … I am sure that number of Integer Objects getting created is causing the i

  • Ares
    android servlets webserver video-streaming httpservice
    I am using HttpService to send responses to android devices and browsers to share some files. This service works on android device. Everything works fine exclude video files. Listening to online music works perfect. But when I try to watch online video my WebService fails with error which you can see below:java.net.SocketException: sendto failed: EPIPE (Broken pipe) at libcore.io.IoBridge.maybeThrowAfterSendto(IoBridge.java:506) at libcore.io.IoBridge.sendto(IoBridge.java:475) at java.net.PlainS

  • keyboardsurfer
    android android-fragments orientation-changes
    I have implemented the tabactivity with 5 tabs. When i change orientation and tabchange i am getting the outOfMemory issue. I tried in the way to setRetainInstance(true); Also set@Overridepublic void onConfigurationChanged(Configuration newConfig) {super.onConfigurationChanged(newConfig);} in my fragment and framentactivity.Also added android:configChanges=”keyboardHidden|orientation|screenLayout|screenSize” in manifest.But no luck. I added my logcat below, 09-03 10:34:30.475: E/dalvikvm-heap(86

  • Haraldo
    android junit android-fragments
    I am just starting out wih junit and the first issue I’m running into is, how should I test fragments?The activity being tested has 1 fragment which is the main layout.@Override protected void setUp() throws Exception {super.setUp();Intent intent = new Intent(getInstrumentation().getTargetContext(),ActivityWelcome.class);startActivity(intent, null, null);FragmentManager fragmentManager = getActivity().getSupportFragmentManager();mFragmentWelcome = (FragmentWelcome) fragmentManager.findFragmentBy

  • Programmer Bruce
    android proguard android-fragments android-lvl android-compat-lib
    I’m trying to use Proguard against my app which will eventually incorporate LVL and In-app Billing. The problem I have is that Proguard keeps crashing my app on start and it’s hard to figure out what’s failing.I’m using the Android V4 support compatibility library and it seems to be blowing away that library as well as some other stuff.Does anyone has a proguard.cfg that works with a basic version of the v4 compat library for starters?Currently I’m using the stock proguard.cfg which doesn’t work

  • JJD
    android backwards-compatibility android-fragments android-inflate
    I am trying to inflate a layout containing a Fragment using the backwards compatibility package. I took the jar file and placed it in the libs folder of my project. I extended Fragment and then tried to inflate it by setting the contentView of the Activity to <LinearLayoutxmlns:android=”http://schemas.android.com/apk/res/android”android:layout_width=”fill_parent”android:layout_height=”fill_parent”android:orientation=”vertical”><fragmentclass=”com.test.fragments.AdFragment”android:layou

  • Goddchen
    android android-fragments youtube-api android-youtube-api
    I am having heavy issues when using YouTubePlayerSupportFragmentIt works fine as long as I am connected to my WiFi, but once I switch to mobile data connection, after a few seconds of successful playback, the fragment seems to try to display some dialog, but fails to do so.Here is the exception:android.view.WindowManager$BadTokenException: Unable to add window — token null is not for an applicationat android.view.ViewRootImpl.setView(ViewRootImpl.java:571)at android.view.WindowManagerGlobal.add

  • gunar
    android android-fragments android-cursorloader
    I am trying to change fragment in OnLoadFinished() method of CursorLoader but I am getting following exception:0-15 13:16:35.565 265-293/system_process E/Lights? write_int failed to open sys/class/leds/rk29_key_led/brightness 10-15 13:19:12.265 4998-4998/com.mobiotics.tvb_stb E/Trace? error opening trace file: No such file or directory (2) 10-15 13:19:12.845 4998-4998/com.mobiotics.tvb_stb E/AndroidRuntime? FATAL EXCEPTION: mainjava.lang.IllegalStateException: Can not perform this act

  • timusus
    android android-fragments android-compatibility
    I’m trying to make my app backwards compatible to Android 2.2.I’ve got Fragments, ListFragments, a FragmentPagerAdapter, and ActionBarSherlock all happening.I’ve got the android support library included, and the build works perfectly on my android 4.1 device, but on the 2.2 device, I get the following:09-21 00:10:32.867: I/dalvikvm(1229): Failed resolving Lanother/music/player/AlbumListFragment; interface 521 ‘Landroid/widget/SearchView$OnQueryTextListener;’ 09-21 00:10:32.877: W/dalvikvm(1229):

  • user1668447
    java android android-fragments android-context
    public class BriefFragmentActivity extends Fragment{public BriefFragmentActivity(){}public static final String ARG_SECTION_NUMBER = “section_number”;String getParameter_Url = “parameters/getParameters”;Spinner spinnerSystemType;ArrayList<String> systemTypeArrayList;DataBaseAdapter dataBaseAdapterInstance;@Overridepublic View onCreateView(LayoutInflater inflater, ViewGroup container,Bundle savedInstanceState) {View v = inflater.inflate(R.layout.brief_fragment_view, null);getAllSpinnerValues

  • user2309862
    android android-fragments nullpointerexception android-viewpager fragmentpageradapter
    I get this error when I try and create a ViewPager for an Activity:FATAL EXCEPTION: main java.lang.NullPointerException at com.blutech.viewpager.PlaceHolderFragment.newInstance(PlaceHolderFragment.java:44) at com.blutech.viewpager.LayoutSlideActivity$SectionsPagerAdapter.getItem(LayoutSlideActivity.java:94) at android.support.v4.app.FragmentPagerAdapter.instantiateItem(FragmentPagerAdapter.java:97) at android.support.v4.view.ViewPager.addNewItem(ViewPager.java:832) at android.support.v4.view.Vie

  • Rijvi Rajib
    android android-fragments android-fragmentactivity
    I’ve used the basic layout created from the Eclipse “Master/Detail” layout. I’ve modified it out and added external pages. However, when I now try to load just ContactListActivity.java, it fails to load giving me the logcat error below. Any ideas on what I’m doing wrong?ContactListActivity.javapackage com.cyphrd.chirpd;import com.cyphrd.chirpd.R;import android.content.Intent; import android.os.Bundle; import android.support.v4.app.FragmentActivity; import android.view.Menu; import android.view.M

  • Droider
    android memory-management android-imageview
    You load in image in ImageView (android) , how is the memory allocated for it?And whether the memory allocated is in 1D array or 2D array? (like in terms of pixels maybe)And which is better BufferedImage or Bitmap for image handling?PS – It is not a duplicate of this.

  • PearsonArtPhoto
    android android-layout bitmap out-of-memory android-imageview
    I’m working on a project and a section of it that has been working for weeks all of a sudden throws the following errorandroid.view.InflateException: Binary XML file line #15: Error inflating class My layout file looks like this. I can’t understand why it would stop working or even a direction as to how to fix it. Here is the xml<?xml version=”1.0″ encoding=”utf-8″?> <LinearLayout xmlns:android=”http://schemas.android.com/apk/res/android”android:orientation=”vertical” android:layout_wi

  • Binghammer
    android bitmap android-imageview android-image bitmapimage
    I have 1024 x 900 image coming from server. And I want to get the half of this image. I use this code img.setImageBitmap(Bitmap.createBitmap(bitmap,0,bitmap.getWidth()/2, bitmap.getWidth(), bitmap.getHeight()/2));But when I do this I have this error y+height must be <=bitmap.getHeightWhat should I do here for not getting the exception.

  • pasta12
    android drag-and-drop imageview android-imageview ontouchlistener
    SOLVEDSee the simple solution in the accepted answer I posted below.The Original ProblemSo I’ve created an onTouchListener for dragging Views. Images drag smoothly if I use getRawX() and getRawY(). The problem with that is the image will jump to the second pointer when you place a second pointer down then lift the first pointer.This onTouchListener attempts to fix that issue by keeping track of the pointerId. The problem with this onTouchListener is while dragging an ImageView, the ImageView jum

  • DonGru
    android android-layout android-imageview
    I am referring to the photo detail view where it looks likeGoogle+ header ——— Photo transparent background meta data (user, description, etc) comments ——— Add comment text input that is always on screen bottomThe Photo, transparent background meta data, and comments all scroll while the Add comment text input remains fixed at the bottom of the screen.  Is this just a ListView with a special zooming ImageView that has the photo size set at runtime?

  • user1129655
    android android-imageview device-orientation
    Below code is to create imageviews dynamically and add to its parent layout on click of a button. This works well. When i change the device orientation, everything is vanishing. i.e, After adding images if i change the device orientation the added images are missing. Why? How can i get back my images after changing the device orientation also? @Override public void onClick(View v) {//create an imageviewImageView img = new ImageView(getApplicationContext());//set layout parametersimg.setLayout

  • Dimitri
    android android-imageview
    I am having trouble to make my imageview appear half of the screen can someone help. here is my xml file. It should take up half of the screen size and also the linear layout with the textview should be at the footer of the imageview.xmlns:tools=”http://schemas.android.com/tools”android:layout_width=”fill_parent”android:layout_height=”fill_parent”android:background=”@drawable/fond” ><RelativeLayoutandroid:layout_width=”fill_parent”android:layout_height=”fill_parent”android:layout_alignPar

  • Daniele Vitali
    android android-imageview
    I want to place 2 ImageViews, one above the other. Here is an example with a square and a circle.How can I do that? I know only in runtime what images to use, so I cannot specify them in an xml file.Thank you in advance.

  • Sajirupee
    java android android-listview android-imageview android-arrayadapter
    I have a ListView that I use to display file/folder hierarchy inside my application. I’m using a custom layout with an ImageView and a TextView. I want to change the image of the ImageView according to TextView text is ether folder or file. Can I do this without using a custom ArrayAdapter or if I have to use a custom ArrayAdapter how can I change ImageView icon in the runtime.?

  • GAMA
    android android-layout android-imageview android-gallery
    I have working sample of image gallery.Now if I have 10 images in gallery, few of them gets displayed initially, lets say 3 (based on image thumbnail dimensions), and rest of the images can be viewed by scrolling the gallery.I want to change this a bit. Based on image thumbnail dimensions, few images should be displayed initially and instead of scrolling, there should be previous and next buttons, on click of which images will shift left or right.Any help appreciated.

Web site is in building