Hi
I have a custom listview with icon and button.
I have a custom BaseAdapter Class and in getview method I have a onClickListener
By Default the button name is Upload, i Will change the button name in "Uploaded" when I click The button.
how can I do it??
Sorry for my English
Related
Hello Guys,
I want to change my today wallpaper. This should happen out of a programm.
Therefore I've written a C++ Programm;
Code:
#include "stdafx.h"
int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow)
{
SendMessage(HWND_BROADCAST, WM_WININICHANGE, 0xF2, 0);
SendMessage(HWND_BROADCAST, WM_SETTINGCHANGE, SPI_SETDESKWALLPAPER, 1);
return 0;
}
I change the Wallpaper by a script. This works. When I open the today stettings I see that my background Image is selected. Afterwards I run this programm. But it doesen't update my Today image.
I hope that someone can help me.
best regards
Robert
Does noone know a solution?
I am successfully changing wallpaper by just copying a new image over the image file in the windows folder and issuing:
SendMessage(HWND_BROADCAST, WM_WININICHANGE, 0xF2, 0);
I found code on the internet that is doing the same thing I'm doing in another language. See http://roam.svn.sourceforge.net/viewvc/roam/Trunk/Source/Roam.UI/Utils/DesktopUtils.cs?revision=73&view=markup and look at the "SetWallpaper" routine. You'll see that the OS wants to use "\Windows\stwater_240_320.jpg" (portrait) and "\Windows\stwater_320_240.jpg" (landscape).
In the code referenced above it just copies a new image(s) over the stwater images and then issues a WM_WININICHANGE message.
As I said, I am doing this now and I see the today screen immediately update. This message forces the wallpaper to load and all the today items to update as well.
I do not even use the
SendMessage(HWND_BROADCAST, WM_SETTINGCHANGE, SPI_SETDESKWALLPAPER, 1);
When I ope the Today Settings, I see that my wallpaper is selected but it isn't updated. I don't to rename my image because it should work for all images.
To change the wallpaper I change the value "Wall" in HKCU\Software\Microsoft\Today in the registry to:"My Documents\Files\Hh_fw_background.png"
But it won't be updated.
Updating the today elements with SendMessage(HWND_BROADCAST, WM_WININICHANGE, 0xF2, 0) works.
usbprog said:
When I ope the Today Settings, I see that my wallpaper is selected but it isn't updated. I don't to rename my image because it should work for all images.
To change the wallpaper I change the value "Wall" in HKCU\Software\Microsoft\Today in the registry to:"My Documents\Files\Hh_fw_background.png"
...
Click to expand...
Click to collapse
I don't think so. When you set a wallpaper in settings or in Pictures/Video, it copies your original image to the 2 images referenced in my previous post. AFAIK everytime you issue a WM_WININICHANGE message, the OS loads the images in the windows folder for the wallpaper. If you don't change those images your wallpaper will never change.
Hey guys
I declared an image in the layout.xml file and now I want it do disappear with a command from the java file.
Any ideas how I could do this?
thx and greez visosilver
You need to give the ImageView an id and then simply reference it from inside the code with something like this:
Code:
ImageView iv = (ImageView) findViewById(id); // id is the id of the image you want to remove
iv.setVisibility(8);
thx a lot dude, thats working!
greez visosilver
Hey everybody, hope you can help me ;-)
my app creates a playlist of type m3u in the folder /sdcard/playlists/filename.m3u.
I'm trying to add the playlist to the MediaStore using MediaScannerConnection, so the playlist is listed in Android's Stock Music App, but it doesn't work: the playlist doesn't show up in the Music App's Category "Playlists".
Here's my code:
Code:
void rescanSD(final File playlistFile) {
msc = new MediaScannerConnection(TracklistActivity.this, new MediaScannerConnectionClient() {
@Override
public void onScanCompleted(String arg0, Uri arg1) {
if (arg0.equals(playlistFile.getAbsolutePath())) {
Log.d("Activity", "File scanned");
msc.disconnect();
}
}
@Override
public void onMediaScannerConnected() {
msc.scanFile(playlistFile.getAbsolutePath(), null);
}
});
msc.connect();
}
The Fileobject File playlistFile is my created m3u-File.
playlistFile.getAbsolutePath() gives: /mnt/sdcard/Music/playlists/filename.m3u
Logcat shows "File scanned", when app has finished, but the playlist doesn't show up in my Music App.
If I initiate a SD-rescan using Tasker the playlist appears in the desired list, so Tasker must be using an other code for realizing that.
Can please anybody tell me where the bug in my code is and give me a suggestion how I can achieve what I want?
Thanks in advance ;-)
Regards ChemDroid
Hi @all,
is it possible to use a string from android/frameworks/base/core/res/res/values in systemui app ?
How do i import the Resources?
a import call to
Code:
import android.core.R;
doesnt work
many thanks for help
In XML files it's usually referenced as "@android/string/whatever"
Well, first I suggest you to use an xml file called strings.xml in the folder ...\MyApp\res\values
Your strings.xml should contain the strings you need, in this format:
<string name="app_name">MyApp</string>
Then, you could refer to the string "app_name" from the main app class or from the xml layout.
From the xml layout, I suppose you have a textView or a Button or whatever. In the declaration you should use:
android:text="@string/app_name"
In the main app class (or other class) you should refer to your layout oblect (a button or whatever) and then access to the string value:
myButton.setText(mContext.getResources().getText(R.string.app_name));
I hope it helps
*** sory for bad English***
hey ,
i have this code
"
Sequnce=(TextView)findViewById(R.id.textView3); "
after that i have a button ' in the botton action(onclicklitner)
i have that
"
for(int i =1; i<100 ; i++){
Sequnce.setText(i +" ");
}
"
when it print "i" i see only 99
how can i see 1,2,3,4,5,6,7......89,99 ?
thx!!!!!
setText merly replaces the text existing text in the textview. So you only see 99. To make the textview show numbers from 1-99, use append instead of setText.
Code:
Sequnce.append(i + ",");
tnx
vijai2011 said:
setText merly replaces the text existing text in the textview. So you only see 99. To make the textview show numbers from 1-99, use append instead of setText.
Code:
Sequnce.append(i + ",");
Click to expand...
Click to collapse
thx!!!
1. what code do i need thet aftter the bottun press it can not be press again ?
2. i wanna have a boutton that re start the progrem , bring it to the beginig or restart the activity .... what cose to put in the on click listner .
tnx!!!!
liadliad5 said:
thx!!!
1. what code do i need thet aftter the bottun press it can not be press again ?
2. i wanna have a boutton that re start the progrem , bring it to the beginig or restart the activity .... what cose to put in the on click listner .
tnx!!!!
Click to expand...
Click to collapse
1:
Use setEnabled():
Code:
myButton.setEnabled(false);
sorry. The internet is bugging me from this morning. I suppose you got the answer for your 1st question from nikwen. For the 2nd one, You can call
Code:
onCreate(null);
to restart the activity.
nikwen said:
1:
Use setEnabled():
Code:
myButton.setEnabled(false);
Click to expand...
Click to collapse
vijai2011 said:
sorry. The internet is bugging me from this morning. I suppose you got the answer for your 1st question from nikwen. For the 2nd one, You can call
Code:
onCreate(null);
to restart the activity.
Click to expand...
Click to collapse
tnx !!!!!
i have more questions
i have a string whit text in my string.xml file i want only 2 words from the string became blod
if i aplly style from my stelys.xml i get all of the string is bold
explain i want
text - " djaisjgidsjfodsjgfds text more text "
tnx for help
liadliad5 said:
tnx !!!!!
i have more questions
i have a string whit text in my string.xml file i want only 2 words from the string became blod
if i aplly style from my stelys.xml i get all of the string is bold
explain i want
text - " djaisjgidsjfodsjgfds text more text "
tnx for help
Click to expand...
Click to collapse
Use html for that. You need to modify one line for that: http://stackoverflow.com/questions/2116162/how-to-display-html-in-textview