I am trying to upload a data to the server using ajax. It was working fine few days before but know its showing following i check the php page query and all is working fine there is no error on the php page . error log:

09-20 17:47:55.459: I/qtaguid(7555): Failed write_ctrl(t 134 43456479100928 2) res=-1 errno=1
09-20 17:47:55.469: I/qtaguid(7555): Tagging socket 134 with tag 278600000000(10118) for uid 2 failed errno=-1
09-20 17:47:55.469: I/qtaguid(7555): Failed write_ctrl(t 135 43456479100928 2) res=-1 errno=1
09-20 17:47:55.469: I/qtaguid(7555): Tagging socket 135 with tag 278600000000(10118) for uid 2 failed errno=-1
 09-20 17:47:55.469: I/qtaguid(7555): Failed write_ctrl(t 136 43456479100928 2) res=-1 errno=1
 09-20 17:47:55.469: I/qtaguid(7555): Tagging socket 136 with tag 278600000000(10118) for uid 2 failed errno=-1
09-20 17:47:59.593: I/Adreno200-EGLSUB(7555): <ConfigWindowMatch:2078>: Format RGBA_8888.

Any Idea is appreciated.

Thanks in advance.

I've tried to write my first serious android app and to list it on google play.

When I'm lancing my app for the first time, everything works fine. When I'm switching to another app, and then when I try to tun my app, I get the following codding error. I assume that is something bad with the path of my mp3 files that I'm using. i think it is related app activities life cycle. Can you tell me how can I simulate the activities life cycle on AVD ?

java.lang.RuntimeException: Unable to start activity ComponentInfo{com.random12.soundtracks/com.random12.soundtracks.MenuActivity}: java.lang.IndexOutOfBoundsException: Invalid index 20, size is 7
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2078)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2103)
at android.app.ActivityThread.access$600(ActivityThread.java:137)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1211)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4839)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:842)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:609)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.IndexOutOfBoundsException: Invalid index 20, size is 7
at java.util.ArrayList.throwIndexOutOfBoundsException(ArrayList.java:251)
at java.util.ArrayList.get(ArrayList.java:304)
at com.random12.soundtracks.MenuActivity.onCreate(Unknown Source)
at android.app.Activity.performCreate(Activity.java:5010)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1079)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2042)
... 11 more

I'm really new on writing java code and in using Eclipse based IDE's (adt bundle to be more specific)

when ia'm building my app i just wanna to display a map with my location

i codded it , but it required me a good internet connection to display or it will crash my all app ..

how can i deal with this issue

is there is any kind of maps can i use in my programming except google maps ???
or any code tricks ??

here is my code :

    package com.gideon.address;

import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;

import android.app.ProgressDialog;
import android.content.Context;
import android.location.Location;
import android.location.LocationListener;
import android.location.LocationManager;
import android.os.Bundle;
import android.os.Handler;

import com.google.android.gms.maps.CameraUpdateFactory;
import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.GoogleMap.OnMyLocationButtonClickListener;
import com.google.android.gms.maps.SupportMapFragment;
import com.google.android.gms.maps.model.BitmapDescriptorFactory;
import com.google.android.gms.maps.model.LatLng;
import com.google.android.gms.maps.model.MarkerOptions;

public class map extends android.support.v4.app.FragmentActivity {
    private GoogleMap mMap; 
    private double mlat;
    private double mlon;
    LocationManager locationManager;
    LocationListener locationListener;
    // All static variables
    static final String URL = "http://procode.co/app_ss/search.php?lat=222&lng=656.111&radius=3200000";
    // XML node keys
    static final String KEY_MARKER = "marker"; // parent node
    static final String KEY_LAT = "lat";
    static final String KEY_LNG = "lng";
    XMLParser parser = new XMLParser();
    String xml = parser.getXmlFromUrl(URL); // getting XML
    Document doc = parser.getDomElement(xml); // getting DOM element

    NodeList nl = doc.getElementsByTagName(KEY_MARKER);

    protected void onCreate(Bundle savedInstanceState) {

        final ProgressDialog dialog = ProgressDialog.show(map.this, "",
                "Loading..Wait..", true);
        Handler handler = new Handler();
        handler.postDelayed(new Runnable() {
            public void run() {
                // your code here
        }, 10000);


    protected void onResume() {

    private void setUpMapIfNeeded() {
        // Do a null check to confirm that we have not already instantiated the
        // map.
        // if (mMap == null) {
        // Try to obtain the map from the SupportMapFragment.

        mMap = ((SupportMapFragment) getSupportFragmentManager()


        // Check if we were successful in obtaining the map.
        // if (mMap != null) {

        mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(new LatLng(
                26.0000, 30.0000), 6));

        mMap.setOnMyLocationButtonClickListener(new OnMyLocationButtonClickListener() {
            public boolean onMyLocationButtonClick() {

                locationManager = (LocationManager) map.this

                // Define a listener that responds to location updates
                locationListener = new LocationListener() {
                    public void onLocationChanged(Location location) {
                        // Called when a new location is found by the
                        // network location provider.

                        mlat = location.getLatitude();
                        mlon = location.getLongitude();

                                new LatLng(mlat, mlon), 12));

                        MarkerOptions marker = new MarkerOptions().position(
                                new LatLng(mlat, mlon)).title("My Location");

                        // Changing marker icon

                        // adding marker

                        // looping through all item nodes <item>
                        for (int i = 0; i < nl.getLength(); i++) {
                            Element e = (Element) nl.item(i);

                            double x = Double.parseDouble(parser.getValue(e,
                            double y = Double.parseDouble(parser.getValue(e,
                            mMap.addMarker(new MarkerOptions().title("สอัิ")
                                    .position(new LatLng(x, y)));




                    public void onStatusChanged(String provider, int status,
                            Bundle extras) {

                    public void onProviderEnabled(String provider) {

                    public void onProviderDisabled(String provider) {

                // Register the listener with the Location Manager to
                // receive location updates
                        LocationManager.NETWORK_PROVIDER, 0, 0,

                return true;

        // }
        // }


Cordova 3.5.0 and JQuery.mobile-1.3.1.min.js use.

Following code is working in browser in small page but not working in long page in Android.

<div data-role="page">    
   <div data-role="content" >
     <div class="contenttile">
                <h2>My Notes
                <ul data-role="listview">
                    <a href="#recipenote" data-ajax="false" id="recipenotelink" data-    transition="slideup">Open Dialog.</a>

<div id="recipenote" data-role="page" data-dialog="true" data-theme="b">
    <div id="notecontent">

I am getting app launcher dialog when i do tap on Home button with two options to set as home app - first, default phone app and second mine app, using this:


public class DefaultLaunchActivity extends Activity {

    protected void onCreate(Bundle savedInstanceState) {


            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.HOME" />
            <category android:name="android.intent.category.DEFAULT" />

But what, if i have to show Application Launcher Dialog whenever user do tap on button

btn.setOnClickListener(new OnClickListener() {

            public void onClick(View arg0) {
                // what to put here to show app launcher dialog         

I would like to draw an indicator line during the drag-drop. I've followed this vogella tutorial and extend it to drawing a line. My problem is, when I call view.startDrag(data, shadowBuilder, view, 0);, a MotionEvent.ACTION_CANCEL is called. So my touch listener cannot catch ACTION_MOVE.

My code snippet:

public boolean onTouch(final View view, final MotionEvent motionEvent) {

        if (motionEvent.getAction() == MotionEvent.ACTION_DOWN) {
            final ClipData data = ClipData.newPlainText("", "");
            final DragShadowBuilder shadowBuilder = new View.DragShadowBuilder(view);

            view.startDrag(data, shadowBuilder, view, 0); // *

            line.setupSrc(new Point(
            return true;

        } else if (motionEvent.getAction() == MotionEvent.ACTION_MOVE) {
            line.setupDst(new Point(
            return true;

        } else {

            return false;


If I comment the line marked as *, the line drawing works fine. But obviously the drag not working.

Is there any solution to get a touch callback during the dragging? I also try the onDragListener, but this fires only on drag events, not the motion events.

I am Trying to see my listview but I can`t. Could you tell me where is the problem please?

My code:

public class VerProyectos extends ActionBarActivity {

private ListView listaProyectos;

private ArrayList<datosProyectos>  proyectos;
private proyectosAdapter adaptador;
private ProgressDialog pDialog;

@SuppressLint("NewApi") @Override
protected void onCreate(Bundle savedInstanceState) {
    ActionBar bar = getActionBar();
    bar.setTitle("Ver Proyectos");
    bar.setBackgroundDrawable(new ColorDrawable(Color.parseColor("#ffa120")));  

    proyectos=new ArrayList<datosProyectos>();
    listaProyectos = (ListView)findViewById(R.id.listaProyectos);

    adaptador = new proyectosAdapter(VerProyectos.this, proyectos);

    listaProyectos.setOnScrollListener(new EndlessScrollListener());


@SuppressLint("NewApi") @Override
public boolean onCreateOptionsMenu(Menu menu) {
     MenuInflater inflater = getMenuInflater();
     inflater.inflate(R.menu.ver_proyectos, menu);       
     return super.onCreateOptionsMenu(menu);

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();
    if (id == R.id.action_settings) {
        return true;
    return super.onOptionsItemSelected(item);

public void onBackPressed() {
    Intent irAMenuInversor = new Intent(this, MenuInversor.class);

class TareaWSObtenerProyectos extends AsyncTask<String,Integer,Boolean> {

    private  ArrayList<datosProyectos> proyectosAux;
        protected void onPreExecute() {
            pDialog = new ProgressDialog(VerProyectos.this);

        protected Boolean doInBackground(String... params) {

            boolean resul = true;

            HttpClient httpClient = new DefaultHttpClient();

            //String id = params[0];
            HttpGet del = 
                    new HttpGet("https://www.sociosinversores.es/service/proyectos?page="+params[0]);
            /*  BasicHttpParams paramsRq = new BasicHttpParams();
              paramsRq.setParameter("page", params[0]);
            del.setHeader("clave", "22c9b09e6b6667bc1da16f255488f8d0");

                HttpResponse resp = httpClient.execute(del);
                String respStr = EntityUtils.toString(resp.getEntity());

                JSONObject respJSON = new JSONObject(respStr);
                JSONArray proyectos = (JSONArray) respJSON.get("proyectos");
                //JSONArray jsonArray = new JSONArray(respJSON);
                proyectosAux = new ArrayList<datosProyectos>();

                for(int i = 0; i < proyectos.length(); i++){                      

                      JSONObject json_data = proyectos.getJSONObject(i);
                      int idmensaje = json_data.getInt("ID");
                      int inversion_minima = json_data.getInt("inversion_minima");
                      int dinero_invertido = json_data.getInt("dinero_invertido");
                      int dinero_proyecto = json_data.getInt("dinero_proyecto");
                      String titulo = json_data.getString("post_title");
                      String resumen = json_data.getString("post_excerpt");
                      String url_imagen = json_data.getString("guid");
                      int progreso=(int)(dinero_invertido*100)/dinero_proyecto;
                      /*Proyecto pro = new Proyecto(idmensaje,titulo,0, "",
                              resumen, inversion_minima,dinero_proyecto,
                      datosProyectos datos = new datosProyectos(dinero_proyecto, dinero_invertido, inversion_minima,
                              titulo, resumen, null, dinero_proyecto, progreso);



            catch(Exception ex)
                Log.e("ServicioRest","Error!", ex);
                resul = false;

            return resul;

        protected void onPostExecute(Boolean result) {
            if (result)



public class EndlessScrollListener implements OnScrollListener {

    private int visibleThreshold = 5;
    private int currentPage = 0;
    private int previousTotal = 0;
    private boolean loading = false;

    public EndlessScrollListener() {
    public EndlessScrollListener(int visibleThreshold) {
        this.visibleThreshold = visibleThreshold;

    public void onScroll(AbsListView view, int firstVisibleItem,
            int visibleItemCount, int totalItemCount) {
        Log.d("Scroll","first: "+firstVisibleItem+"VisibleItem: "+visibleItemCount+"total_item : "+totalItemCount+"Load:"+loading+"previusTotal :"+previousTotal);
        if (loading) {

            if (totalItemCount > previousTotal) {
                loading = false;
                previousTotal = totalItemCount;
        if (!loading && (totalItemCount - firstVisibleItem) <= (visibleItemCount )) {
            // I load the next page of gigs using a background task,
            // but you can call any function here.
          //  new LoadGigsTask().execute(currentPage + 1);
             (new TareaWSObtenerProyectos()).execute(String.valueOf(currentPage));
            loading = true;

    public void onScrollStateChanged(AbsListView view, int scrollState) {

just i made the proper alignment of code ....................... ............................................................................................................................................


I'm currently developing an application for Android which revolves around an alarm that goes of on an user specified time. My intent for it is that it will be used for waking people up in the morning (and the following morning - aka repeating alarm). When the alarm goes of it will call an Activity that has a couple of options (such as snooze). I've got all of this working but I'm running in to a problem.


I'm using AlarmManager to handle my alarm needs. There is however something curious going on with the class (in my opinion). There are two adviced ways to handle the setting of the alarm time. Namely setInexactRepeating and setRepeating. The problem with these functions are:

  • setInexactRepeating is not very accurate. My tests have shown that this gets approximately activated at the specified time, which the documentation indicates, all be it rather vaguely;

    the alarm will not fire before this time, but there may be a delay of almost an entire alarm interval before the first invocation of the alarm.

    My tests show there is usually something of a 5 minute delay. This won't do, of course, for a system that is supposed to wake people up at their specified times.

  • setRepeating does trigger at the specified time. The docs specify however that as of API 19 that all repeating alarms are inexact. Which is exactly what I don't want.

    As of API 19, all repeating alarms are inexact. Because this method has been available since API 3, your application can safely call it and be assured that it will get similar behavior on both current and older versions of Android.

There is a setExact method, but this is a bit too specific. Aside from that it does not give me the option to have a certain interval (for repeating the alarm daily).


Am I using the wrong class for this system? To me it seems like it should be a legit usage, but reading through the docs has left me wondering. Is there perhaps another class which is better suited for this system?

I'd like to use my Android phone as a wireless microphone.

The WO Mic app is an example of what I want to do but I want it to work with Linux.

What possibility is there to send audio through Wifi and make the computer handle that signal as with a regular microphone?

What knowledge should I have to develop that application (apart from generic Android programming)?

I need to start an app when the [Android] phone starts.
I compiled this code, and the app doesn't crash but doesn't show me anything either!
Now I'm trying with Toast but it still isn't found. Can someone help me?

This is the main activity:

package com.example.simplenotification;

import android.app.Activity;
import android.app.AlarmManager;
import android.app.Notification;
import android.app.NotificationManager; 
import android.app.PendingIntent;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.NotificationCompat;
import android.support.v4.app.NotificationManagerCompat;  
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.RemoteViews;
import android.widget.Toast;

public class MainActivity extends Activity {

 private static final int MY_NOTIFICATION_ID = 0;

 private int mNotificationCount;

 private final CharSequence tickerText ="this is tickerText";
 private final CharSequence contentTitle="this contentTitle";
 private final CharSequence contentText="this coontentText";

 private Intent mNotificationIntent;
 private PendingIntent mContentIntent;

 RemoteViews mContentView = new RemoteViews("com.example.simplenotification.StatusBarWithCustomView", R.layout.custom_view);
protected void onCreate(Bundle savedInstanceState) {

    mNotificationIntent = new Intent(getApplicationContext(),AppGet.class);
    mContentIntent = PendingIntent.getActivity(getApplicationContext(), 0, mNotificationIntent, Intent.FLAG_ACTIVITY_NEW_TASK);
    final Button button = (Button) findViewById(R.id.button1);

    button.setOnClickListener(new OnClickListener() {

        public void onClick(View v){





public class BootUpReceiver extends BroadcastReceiver {
        public void onReceive(Context context, Intent intent) 
        if (intent.getAction().equals(Intent.ACTION_BOOT_COMPLETED)) {
            Intent i = new Intent();
            //Toast.makeText(context , "saranno 3?" , Toast.LENGTH_SHORT).show();




public void startNotification(){
    Intent notificationIntent = new Intent(getApplicationContext(), MainActivity.class);
    // set intent so it does not start a new activity
    notificationIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP |
    PendingIntent intent =
            PendingIntent.getActivity(MainActivity.this, 0, notificationIntent, 0);

    NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(getApplicationContext())
    .setContentTitle("titolo content")
    .setContentText("content text")

    NotificationManagerCompat mNotificationManager = NotificationManagerCompat.from(getApplicationContext());

This the Manifest.xml:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
android:versionName="1.0" >

    android:targetSdkVersion="14" />

    android:theme="@style/AppTheme" >
        android:label="@string/app_name" >
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
     <receiver android:enabled="true" android:name=".receivers.BootUpReceiver"
        <action android:name="android.intent.action.BOOT_COMPLETED" />
        <category android:name="android.intent.category.DEFAULT" />

I don't know how debug the app autorun on emulator. I'm sorry

One disadvantage to pull requests is lots and lots of merge commits.

It's not the worst thing, but it does clutter the commit logs, and make for lots of unnecessary non-sequential history.

A - C - E - G
   /   /   /
  B   D   F

What I think would be better is to cherry-pick the commits.

A - B' - D' - F'

Of course I can do that myself, but one of the advantages in a pull request system like Github, Bitbucket, Stash, or Gerrit is the ability to do this through the interface, immediately following a review of the changes. And doing that manually wouldn't show the pull request as accepted in the UI.

Why don't pull request tools offer "cherry-pick requests"?

I understand the advantages of merges and non-sequential history in the general case. (Otherwise, I'd be using SVN.) I am specifically taking about one or two commit changes from transient branches. (Many tools even help you delete the branch right after merging.) A one-commit change is probably the most common case for pull requests.

TOP programming language for coding worms,Trojan,virus,... any idea? If C++ is best, how can I reduce the compiled file size so it can distribute in the internet rapidly? Default optimizer in c-compiler can not reduce file size too much. Any specific c++ compiler for writing worms in C++? any idea I need to write a code that automatically distribute and affect systems, e.g. a virus can be a key-logger and send any typed data automatically to a server or email,... that I can access all victim systems typed data with keyboard?

I need to make an application that create flash across screen while it's open in the task manager. The flash is the white flash just like when you do capture the screen in idevices.

The reason I need is my iphone got hardware error that make screen colour negative. The only time that it's display right colour is the time I capture the screen and that flash comes up. If this idea is impossible , i would need to purchase new screen for replacement. And that's expensive.

So, Is this possible?

Thanks you in advance

I am a graduate in computerscience, and I worked in the sharepoint development (MOSS 2007) field for around 4 years, but now I have a gap of about 5 years in my career. What are my options to restart my career? Can anyone suggest some courses to enter the software field?Will software testing be a good choice or should i continue with sharepoint development?

After updating my nokia5233 phone software radio does not work. The software version is v51.1.002. So please help me get out this problem.

I want to assign a class to a delegate, but it raise an error: Expected member name following '.' How could I do it?

let frc = NSFetchedResultsController(fetchRequest: fr, managedObjectContext: Utility.managedObjectContext(), sectionNameKeyPath: nil, cacheName: nil)
frc.delegate = Utility.class

I was trying to use iCarousel for one my solutions, I need to achieve something like the image below:


With 12 cards only with normal rotation, each of them should rotate with approximately 10 degree. No need any scale or alpha effect.

By setting the iCarousel's iCarouselTypeCustom type in the delegate method:

self.carousel.type = iCarouselTypeCustom;

And then how to calculate it?

- (CATransform3D)carousel:(iCarousel *)carousel itemTransformForOffset:(CGFloat)offset baseTransform:(CATransform3D)transform

  transform = ?

  return transform;    

I have implemented a filter tool mechanism which has many filters. Each filter contains 2-3 different filters i.e. i am using GPUImageFilterGroup for this. Now when i updated GPU Image Library for iOS 8 compatible it shows "Instance Method prepareForImageCapture not found" and app crashes.

enter image description here

I also tried to implement the following code

GPUImageFilterGroup *filter = [[GPUImageFilterGroup alloc] init];

    GPUImageRGBFilter *stillImageFilter1 = [[GPUImageRGBFilter alloc] init];
//    [stillImageFilter1 prepareForImageCapture];

    stillImageFilter1.red = 0.2;
    stillImageFilter1.green = 0.8;
        [stillImageFilter1 useNextFrameForImageCapture];
    [(GPUImageFilterGroup *)filter addFilter:stillImageFilter1];

    GPUImageVignetteFilter *stillImageFilter2 = [[GPUImageVignetteFilter alloc] init];
//    [stillImageFilter1 prepareForImageCapture];
    stillImageFilter2.vignetteStart = 0.32;
    [stillImageFilter1 useNextFrameForImageCapture];
    [(GPUImageFilterGroup *)filter addFilter:stillImageFilter2];

    [stillImageFilter1 addTarget:stillImageFilter2];

    [(GPUImageFilterGroup *)filter setInitialFilters:[NSArray arrayWithObject:stillImageFilter1]];
    [(GPUImageFilterGroup *)filter setTerminalFilter:stillImageFilter2];

    GPUImagePicture *stillImageSource = [[GPUImagePicture alloc] initWithImage:image];
    [stillImageSource addTarget:(GPUImageFilterGroup *)filter];
    [stillImageSource processImage];

    UIImage *img = [(GPUImageFilterGroup *)filter imageFromCurrentFramebuffer];

Its returning nil image. Can anyone tell me whats the correct way!!!

Thanks in advance.

I want to decode two base 64 encoded strings and combine them to make one 128 bit string. I am able to decode the Base64 encoded strings. Can some one guide me on how to combine these two decoded strings?

This is the code I used for decoding the two encoded strings.

NSData *decodedData_contentKey = [[NSData alloc] initWithBase64EncodedString:str_content options:0];
NSString *decodedString_contentKey = [[NSString alloc] initWithData:decodedData_contentKey encoding:NSUTF8StringEncoding];
NSLog(@"%@", decodedString_contentKey); 


I have a table view, which lists out contacts. On tapping edit cell reloads and presents labels as text inputs. I need to have save button on top right, so when I tap on save how can I get the updated inputs from Cell ? Since action is triggered from outside I need to send a message to cell some how.

For now I am getting the data using cellForRowAtIndexPath and by accessing cells properties.

CustomCell *cell = [tableView dequeueReusableCellWithIdentifier:@"id "forIndexPath:editCellIdx];
NSString *input 1 = cell.labelOne.text; ... and so on

Is there any better way ?

I have a UIScrollview of buttons and each time I click one of them i change its backgrund, image and label. It was working fine until today it crashes and it say unrecognized selector. When I NSLog my buttons i can see the second time the are not anymore buttons but UIImageViews.

How the hell can that happen ?

the code is very big but this is the problem part

for (int j = 100; j<[[Utils categoriesName] count]+100; j++)
    UIButton *clickedButton = (UIButton *)[self.view viewWithTag:j];
    UILabel *clickedLabel = (UILabel *)[self.view viewWithTag:j+100];
    NSLog(@"%@  \n%@\n\n",clicked Button, clickedLabel);
    [clickedButton setImage:[UIImage imageNamed:[[Utils categoriesIconLight] objectAtIndex:(j-100)]] forState:UIControlStateNormal];
    [clickedButton setImage:[UIImage imageNamed:[[Utils categoriesIconLight] objectAtIndex:(j-100)]] forState:UIControlStateHighlighted];
    [clickedLabel setTextColor:[UIColor whiteColor]];
    [clickedButton setBackgroundImage:[UIImage imageNamed:@"category-button-background"] forState:UIControlStateNormal];
    [clickedButton setBackgroundImage:[UIImage imageNamed:@"category-button-background-selected"] forState:UIControlStateHighlighted];
    [clickedButton setBackgroundColor:[UIColor clearColor]];

the second time this loop is run clickedButton and clickedLabel are both UIImageViews