help on Android

by Billsen » Fri, 27 Jun 2008 07:48:50 GMT


Sponsored Links
 Hi,

I am a new comer to Android and need a help. Here is my question? How
to get to a new activity by clicking a button.
What is what I did.

In class CompantMenu, I have code like this

.........
.........
 listButton.setOnClickListener(new View.OnClickListener() {
                public void onClick(View view) {
                        listCompany();

                }
            });

.........
.........
public void listCompany(){
                Intent i = new Intent(this,ListCompany.class);
                startActivity(i);
        }

In class ListCompany, I have code like this,

 public void onCreate(Bundle icicle) {
                 super.onCreate(icicle);
                setContentView(R.layout.list_company);
         }

Node:list_company.xml is availabe and classes ListCompany CompantMenu
are in AndroidManifest.xml.

When I lick listButton, I did not get page defined by list_company,
instead, I got java.long.NullPointerException.

How solve this issue?

Thanks

Billsen

--~--~---------~--~----~------------~-------~--~----~



help on Android

by Mark Murphy » Fri, 27 Jun 2008 08:20:38 GMT


 


You should probably look at the stack trace (e.g., via adb logcat) to 
see where exactly you got the exception. That may help you determine if 
the problem is with CompantMenu or with ListCompany and may give you a 
clue as to what pointer is null.

-- 
Mark Murphy (a Commons Guy)
 http://commonsware.com 
Warescription: All titles, revisions, & ebook formats, just $35/year

--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


help on Android

by Juven Xu » Fri, 27 Jun 2008 11:56:11 GMT


 please paste the stack trace to help figure out the root cause



--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. adb over wifi

Hi,

has anyone managed to connect to a device with adb over a wifi connection? I'd
like to stop plugging the device in and out if possible. Hackish solutions are
welcome too.

--
  Olivier

-- 

2. Not able to port Libltdl on Android

Hi All ... I am trying to port Libltdl library ... I refered to the
post

http://www.mail-archive.com/android-freerun...@android.koolu.org/msg00334.html


   I have a small issue .  I hope it is not wrong to ask your guidance
to solve the same.  When I try to build the given libltdl in Froyo
Android , It is throwing many errors . We tried to build the same code
using NDK Crystax too . Again the same errors are surfacing . I am not
able to figure out why the errors are caused . Could you please have a
look at the log below and offer some advice ? In your post ,you
mentioed that
Then under that is a directory called android,

which contains the config.h and other android build specific files.


What are the "other android build specific files you are talking
about ? Am I missing something else here ?  Your Help will be greatly
appreciated as we need the Libltdl up and running on Android very
badly .


cet...@ceteam-laptop:~/froyo_x86_source/froyo-x86$ sudo make iso_img
TARGET_PRODUCT=generic_x86
[sudo] password for ceteam:
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=2.2
TARGET_PRODUCT=generic_x86
TARGET_BUILD_VARIANT=eng
TARGET_SIMULATOR=
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=x86
HOST_ARCH=x86
HOST_OS=linux
HOST_BUILD_TYPE=release
BUILD_ID=MASTER
============================================
build/core/base_rules.mk:108: user tag on app CustomLibraryClient at
packages/apps/client - add your app to core.mk instead
find: `ethernet/java': No such file or directory
find: `ethernet/java': No such file or directory
build/core/base_rules.mk:108: user tag on app LIME at packages/apps/
LIME - add your app to core.mk instead
build/core/base_rules.mk:108: user tag on app FileManager at packages/
apps/Filemanager - add your app to core.mk instead
build/core/base_rules.mk:108: user tag on app Hello at packages/apps/
hello - add your app to core.mk instead
build/core/base_rules.mk:69: unusual tags systembuilder on badblocks
at external/e2fsprogs/misc
Install: out/target/product/generic_x86/system/app/Mms.apk
target  C: libltdl <= external/libltdl/ltdl.c
external/libltdl/ltdl.c: In function 'rpl_memcpy':
external/libltdl/ltdl.c:392: warning: pointer of type 'void *' used in
arithmetic
external/libltdl/ltdl.c:392: warning: dereferencing 'void *' pointer
external/libltdl/ltdl.c:392: warning: pointer of type 'void *' used in
arithmetic
external/libltdl/ltdl.c:392: warning: dereferencing 'void *' pointer
external/libltdl/ltdl.c:392: error: invalid use of void expression
external/libltdl/ltdl.c: At top level:
external/libltdl/ltdl.c:564: error: expected '=', ',', ';', 'asm' or
'__attribute__' before 'rpl_argz_append'
external/libltdl/ltdl.c:569: error: expected identifier or '(' before
'{' token
external/libltdl/ltdl.c:602: error: expected '=', ',', ';', 'asm' or
'__attribute__' before 'rpl_argz_create_sep'
external/libltdl/ltdl.c:606: error: expected '=', ',', ';', 'asm' or
'__attribute__' before 'rpl_argz_create_sep'
external/libltdl/ltdl.c:611: error: expected identifier or '(' before
'{' token
external/libltdl/ltdl.c:665: error: expected '=', ',', ';', 'asm' or
'__attribute__' before 'rpl_argz_insert'
external/libltdl/ltdl.c:669: error: expected '=', ',', ';', 'asm' or
'__attribute__' before 'rpl_argz_insert'
external/libltdl/ltdl.c:674: error: expected identifier or '(' before
'{' token
external/libltdl/ltdl.c:857: error: 'LTDL_OBJDIR' undeclared here (not
in a function)
external/libltdl/ltdl.c: In function 'presym_init':
external/libltdl/ltdl.c:1942: warning: unused parameter 'loader_data'
external/libltdl/ltdl.c: In function 'presym_exit':
external/libltdl/ltdl.c:1983: warning: unused parameter 'loader_data'
external/libltdl/ltdl.c: In function 'presym_open':
external/libltdl/ltdl.c:2029: warning: unused parameter 'loader_data'
external/libltdl/ltdl.c: In function 'presym_close':
external/libltdl/ltdl.c:2079: warning: unused parameter 'loader_data'
external/libltdl/ltdl.c: In function 'presym_sym':
external/libltdl/ltdl.c:2089: warning: unused parameter 'loader_data'
external/libltdl/ltdl.c: At top level:
external/libltdl/ltdl.c:2144: error: expected '=', ',', ';', 'asm' or
'__attribute__' before '*' token
external/libltdl/ltdl.c:2174: warning: 'struct direct' declared inside
parameter list
external/libltdl/ltdl.c:2174: warning: its scope is only this
definition or declaration, which is probably not what you want
external/libltdl/ltdl.c: In function 'tryall_dlopen_module':
external/libltdl/ltdl.c:2479: warning: implicit declaration of
function 'sprintf'
external/libltdl/ltdl.c:2479: warning: incompatible implicit
declaration of built-in function 'sprintf'
external/libltdl/ltdl.c: In function 'argzize_path':
external/libltdl/ltdl.c:2614: error: 'error_t' undeclared (first use
in this function)
external/libltdl/ltdl.c:2614: error: (Each undeclared identifier is
reported only once
external/libltdl/ltdl.c:2614: error: for each function it appears in.)
external/libltdl/ltdl.c:2614: warning: statement with no effect
external/libltdl/ltdl.c:2614: error: expected ';' before 'error'
external/libltdl/ltdl.c:2620: error: 'error' undeclared (first use in
this function)
external/libltdl/ltdl.c:2620: warning: implicit declaration of
function 'rpl_argz_create_sep'
external/libltdl/ltdl.c:2624: error: 'ENOMEM' undeclared (first use in
this function)
external/libltdl/ltdl.c: In function 'foreach_dirinpath':
external/libltdl/ltdl.c:2678: warning: comparison between signed and
unsigned
external/libltdl/ltdl.c: In function 'find_file_callback':
external/libltdl/ltdl.c:2724: error: 'FILE' undeclared (first use in
this function)
external/libltdl/ltdl.c:2724: error: 'pfile' undeclared (first use in
this function)
external/libltdl/ltdl.c:2724: error: invalid operands to binary *
external/libltdl/ltdl.c:2724: error: expected expression before ')'
token
external/libltdl/ltdl.c:2724: error: invalid operands to binary *
external/libltdl/ltdl.c:2724: warning: statement with no effect
external/libltdl/ltdl.c:2731: warning: implicit declaration of
function 'fopen'
external/libltdl/ltdl.c:2731: error: assignment of read-only location
external/libltdl/ltdl.c:2733: warning: initialization discards
qualifiers from pointer target type
external/libltdl/ltdl.c:2721: warning: unused parameter 'data2'
external/libltdl/ltdl.c: At top level:
external/libltdl/ltdl.c:2746: error: expected '=', ',', ';', 'asm' or
'__attribute__' before '*' token
external/libltdl/ltdl.c:2751: error: expected identifier or '(' before
'{' token
external/libltdl/ltdl.c: In function 'find_handle_callback':
external/libltdl/ltdl.c:2763: warning: unused parameter 'ignored'
external/libltdl/ltdl.c: In function 'load_deplibs':
external/libltdl/ltdl.c:2801: warning: unused parameter 'deplibs'
external/libltdl/ltdl.c: In function 'try_dlopen':
external/libltdl/ltdl.c:3082: warning: assignment discards qualifiers
from pointer target type
external/libltdl/ltdl.c:3109: error: 'FILE' undeclared (first use in
this function)
external/libltdl/ltdl.c:3109: error: 'file' undeclared (first use in
this function)
external/libltdl/ltdl.c:3109: error: invalid operands to binary *
external/libltdl/ltdl.c:3109: warning: statement with no effect
external/libltdl/ltdl.c:3133: warning: comparison between signed and
unsigned
external/libltdl/ltdl.c:3135: warning: implicit declaration of
function 'isalnum'
external/libltdl/ltdl.c:3158: warning: implicit declaration of
function 'find_file'
external/libltdl/ltdl.c:3158: warning: statement with no effect
external/libltdl/ltdl.c:3165: warning: statement with no effect
external/libltdl/ltdl.c:3185: warning: statement with no effect
external/libltdl/ltdl.c:3201: warning: implicit declaration of
function 'fclose'
external/libltdl/ltdl.c:3207: warning: implicit declaration of
function 'feof'
external/libltdl/ltdl.c:3209: warning: implicit declaration of
function 'fgets'
external/libltdl/ltdl.c:3277: warning: assignment discards qualifiers
from pointer target type
external/libltdl/ltdl.c: In function 'lt_dlopenext':
external/libltdl/ltdl.c:3454: warning: assignment discards qualifiers
from pointer target type
external/libltdl/ltdl.c:3468: error: the address of 'archive_ext' will
always evaluate as 'true'
external/libltdl/ltdl.c: In function 'lt_argz_insert':
external/libltdl/ltdl.c:3531: error: 'error_t' undeclared (first use
in this function)
external/libltdl/ltdl.c:3531: warning: statement with no effect
external/libltdl/ltdl.c:3531: error: expected ';' before 'error'
external/libltdl/ltdl.c:3533: error: 'error' undeclared (first use in
this function)
external/libltdl/ltdl.c:3533: warning: implicit declaration of
function 'rpl_argz_insert'
external/libltdl/ltdl.c:3537: error: 'ENOMEM' undeclared (first use in
this function)
external/libltdl/ltdl.c: In function 'lt_argz_insertdir':
external/libltdl/ltdl.c:3580: error: argument 'dp' doesn't match
prototype
external/libltdl/ltdl.c:2174: error: prototype declaration
external/libltdl/ltdl.c:3593: error: dereferencing pointer to
incomplete type
external/libltdl/ltdl.c:3593: error: request for member 'd_name' in
something not a structure or union
external/libltdl/ltdl.c:3593: error: dereferencing pointer to
incomplete type
external/libltdl/ltdl.c:3593: error: request for member 'd_namlen' in
something not a structure or union
external/libltdl/ltdl.c:3593: error: invalid operands to binary +
external/libltdl/ltdl.c:3593: warning: assignment discards qualifiers
from pointer target type
external/libltdl/ltdl.c:3598: error: dereferencing pointer to
incomplete type
external/libltdl/ltdl.c:3598: error: request for member 'd_name' in
something not a structure or union
external/libltdl/ltdl.c:3609: error: dereferencing pointer to
incomplete type
external/libltdl/ltdl.c:3609: error: request for member 'd_name' in
something not a structure or union
external/libltdl/ltdl.c:3618: error: dereferencing pointer to
incomplete type
external/libltdl/ltdl.c:3618: error: request for member 'd_name' in
something not a structure or union
external/libltdl/ltdl.c:3628: error: dereferencing pointer to
incomplete type
external/libltdl/ltdl.c:3628: error: request for member 'd_name' in
something not a structure or union
external/libltdl/ltdl.c: In function 'list_files_by_dir':
external/libltdl/ltdl.c:3646: error: 'DIR' undeclared (first use in
this function)
external/libltdl/ltdl.c:3646: error: 'dirp' undeclared (first use in
this function)
external/libltdl/ltdl.c:3646: error: invalid operands to binary *
external/libltdl/ltdl.c:3646: warning: statement with no effect
external/libltdl/ltdl.c:3654: warning: implicit declaration of
function 'opendir'
external/libltdl/ltdl.c:3654: warning: statement with no effect
external/libltdl/ltdl.c:3659: warning: implicit declaration of
function 'readdir'
external/libltdl/ltdl.c:3659: warning: assignment makes pointer from
integer without a cast
external/libltdl/ltdl.c:3660: error: dereferencing pointer to
incomplete type
external/libltdl/ltdl.c:3660: error: request for member 'd_name' in
something not a structure or union
external/libltdl/ltdl.c:3661: warning: passing argument 4 of
'lt_argz_insertdir' from incompatible pointer type
external/libltdl/ltdl.c:3667: warning: implicit declaration of
function 'closedir'
make: *** [out/target/product/generic_x86/obj/SHARED_LIBRARIES/
libltdl_intermediates/ltdl.o] Error 1


-- 
unsubscribe: android-porting+unsubscr...@googlegroups.com
website: 

3. listview with different xml for rows

4. wifi is not disconnecting in suspend mode

5. Support for Atheros AR300x serial chip in Android kernel

6. is there a way to implement screenshot functionality in android

7. Adding permission in framework.